From: Simon Wilkinson Date: Sat, 12 Jun 2010 09:35:34 +0000 (+0100) Subject: fs: Can't use store behind data if pioctl errored X-Git-Tag: openafs-devel-1_5_75~142 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=904c9fbebab97b760dd853fa393e1c576c7db00c;p=packages%2Fo%2Fopenafs.git fs: Can't use store behind data if pioctl errored If the call to a pioctl returns an error, it's possible to reach the end of the storebehind function and try and print an old, or bogus, value from the pioctl data block. Caught by clang-analyzer Change-Id: I1209c0c24730273510fbad98a75a429917836605 Reviewed-on: http://gerrit.openafs.org/2142 Reviewed-by: Russ Allbery Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/venus/fs.c b/src/venus/fs.c index e37a404ea..9cc6409ae 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -3341,7 +3341,7 @@ StoreBehindCmd(struct cmd_syndesc *as, void *arock) } /* Having no arguments also reports the default store asynchrony */ - if (verbose && (blob.out_size == sizeof(tsb2))) { + if (!error && verbose && (blob.out_size == sizeof(tsb2))) { fprintf(stdout, "Default store asynchrony is %d kbytes.\n", (tsb2.sb_default / 1024)); }