]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
fstrace: Don't read uninitialised data on other platforms either
authorStephan Wiesand <stephan.wiesand@desy.de>
Mon, 2 Jun 2014 14:15:15 +0000 (16:15 +0200)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 26 Jun 2014 09:18:41 +0000 (05:18 -0400)
Commit 908105fe8d51551e45692de4e145022138a0356c fixed an off-by-one
error potentially causing a buffer overread in CheckTypes, but only
in the IRIX/AIX version of the function. Apply the same fix to the
code for the other platforms.

Spotted by Andrew Deason.

Reviewed-on: http://gerrit.openafs.org/11185
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 3ab546395536a3c93613dfd53363d380e2c05081)

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

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