]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
fstrace: Don't read uninitialised data
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Mar 2013 11:49:13 +0000 (11:49 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Jun 2014 16:48:22 +0000 (12:48 -0400)
The pftix variable points to the next free element in the
printfTypes array, so when we iterate through that array to
read that data back, we should stop when our iterator equals
pftix, not when it is greater than it.

Caught by coverity (#986013)

Reviewed-on: http://gerrit.openafs.org/9442
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 908105fe8d51551e45692de4e145022138a0356c)

Change-Id: I2dec4dc3b041093e1d1ac2ea4546a341e9b00687
Reviewed-on: http://gerrit.openafs.org/11053
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/venus/fstrace.c

index b677431c400c8b327ba7dd411dc04f93aafd1e56..4c3d3e0971970d0b4e8e415028e530d0b4fedb17 100644 (file)
@@ -171,7 +171,7 @@ CheckTypes(char *bufferp, int *typesp, int typeCount, char *outMsgBuffer)
             * check the type descriptor.
             */
            inPercent = 0;
-           if (tix > typeCount)
+           if (tix >= typeCount)
                return 0;       /* no more type descriptors left */
            if (tc == 's') {
                if (typesp[tix] != 1)   /* not a string descriptor */