OpenAFS Master Repository branch, master, updated. BP--openafs-stable-1_6_x-1568-g40c9163
Gerrit Code Review
gerrit@openafs.org
Sun, 28 Aug 2011 20:47:20 -0700 (PDT)
The following commit has been merged in the master branch:
commit 40c9163aa9f266c4ad3a0a5a68e0aae0c35e3e51
Author: Garrett Wollman <wollman@csail.mit.edu>
Date: Mon Aug 8 23:59:17 2011 -0400
libafs: crash in a more useful way if nchunks is zero
In afs_CacheStoreDCaches(), if the parameter nchunks is zero, the
main loop will not execute, leaving the XSTATS pointer unchanged,
which will result in a null dereference in XSTATS_END_TIME. Instead
assert that nchunks is nonzero, which will help the static analyzer
and will also generate a more useful panic message should this
error ever be encountered in operation.
There is presently only one call site, and it may be the case that this
condition can never be triggered.
(While in the neighborhood, also avoid dereferencing tdc immediately
before testing whether it is null.)
Change-Id: Idf68f1306d3e09771425c62df139c1de11806c22
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5179
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/afs_fetchstore.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
--
OpenAFS Master Repository