Subject: bin/30411: fsck_lfs uninitalized vars in pass6.c::rfw_update_single()
To: None <firstname.lastname@example.org, email@example.com>
From: None <lukem@NetBSD.org>
Date: 06/03/2005 06:31:00
>Synopsis: fsck_lfs uninitalized vars in pass6.c::rfw_update_single()
>Arrival-Date: Fri Jun 03 06:31:00 +0000 2005
>Originator: Luke Mewburn
>Release: NetBSD 3.0_BETA
When compiling fsck_lfs/pass6.c with -Wuninitalized, the
following warnings are triggered:
pass6.c: In function `rfw_update_single':
pass6.c:93: warning: `osize' might be used uninitialized in this function
pass6.c:93: warning: `obb' might be used uninitialized in this function
My examination of the code shows that just initializing these
to 0 at the start of the function to appease the warning
isn't necessarily "safe", because:
* osize isn't set if daddr <= 0, yet it's possibly used
when daddr >= 0 later on.
(I.e, osize isn't initialized yet is used when daddr == 0)
* obb is only set in some circumstances but is used to
update bfree accounting.
I don't understand the LFS code enough to fix this correctly.
Compile with -Wuninitialized.
(See PR 30394 for a related problem).