From: Garrett Wollman Date: Sun, 7 Aug 2011 04:09:33 +0000 (-0400) Subject: afs_pioctl: don't use cell uninitialized in PGetTokens2 X-Git-Tag: upstream/1.8.0_pre1^2~3434 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8776f194173bf688da9982845303c98da458fa3f;p=packages%2Fo%2Fopenafs.git afs_pioctl: don't use cell uninitialized in PGetTokens2 An unlikely error condition could lead to the variable cell in PGetTokens2 being passed uninitialized to afs_PutCell. Initialize it to NULL beforehand to avoid this. Change-Id: Ia8ded86df9d8af2f08c02d39749252d98a6c9ffe Found-by: clang static analyzer Reviewed-on: http://gerrit.openafs.org/5168 Tested-by: BuildBot Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index ff3e87d21..38a9999a5 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -5380,7 +5380,7 @@ out: DECL_PIOCTL(PGetTokens2) { - struct cell *cell; + struct cell *cell = NULL; struct unixuser *tu = NULL; afs_int32 iterator; char *cellName = NULL;