From: Stephan Wiesand Date: Mon, 2 Jun 2014 14:15:15 +0000 (+0200) Subject: fstrace: Don't read uninitialised data on other platforms either X-Git-Tag: upstream/1.6.10_pre1^2~106 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=04ef24659a428af037dfb3a3d368142cd3ffd8c3;p=packages%2Fo%2Fopenafs.git fstrace: Don't read uninitialised data on other platforms either 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 Tested-by: BuildBot (cherry picked from commit 3ab546395536a3c93613dfd53363d380e2c05081) Change-Id: Iea700be24803d8156f07d1cf0617ba7aa2aa03d5 Reviewed-on: http://gerrit.openafs.org/11196 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Perry Ruiter Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- diff --git a/src/venus/fstrace.c b/src/venus/fstrace.c index 4c3d3e097..d5a54cbdc 100644 --- a/src/venus/fstrace.c +++ b/src/venus/fstrace.c @@ -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;