]> git.michaelhowe.org Git - packages/o/openafs.git/commit
afs_fetchstore: re-avoid uninitialized variable
authorBenjamin Kaduk <kaduk@mit.edu>
Wed, 5 Feb 2014 23:32:16 +0000 (18:32 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 19 Feb 2014 13:03:44 +0000 (05:03 -0800)
commit2667f59e12ddba9d73c9996a28d7c63414887713
treeefe8379b827b6471f668e168a2383a5dcdd39d30
parent596b464d20150bbb816176cb278e2e9c845edecd
afs_fetchstore: re-avoid uninitialized variable

As noted in the gerrit comments for change 10742, commit
baf6af8a8f2207ce39b746d59ca4bc661c002883 does not handle the case
where the second rx_Read() call fails, and the 'length' variable
can still be used uninitialized.

Instead of using an err label and jumping to it on the case of
errors, initialize length to zero and take care to neither
set nor access *alength if an error has occurred.  This is
more consistent with the style of the surrounding code while still
avoiding the use of an uninitialized variable.

Reviewed-on: http://gerrit.openafs.org/10806
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit b7326e487f6387033282cc5d1128b00a0456673a)

Change-Id: I371ec319b9a984e61e41a30110b8f2c0cf14b379
Reviewed-on: http://gerrit.openafs.org/10835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/afs_fetchstore.c