From 3ab546395536a3c93613dfd53363d380e2c05081 Mon Sep 17 00:00:00 2001 From: Stephan Wiesand Date: Mon, 2 Jun 2014 16:15:15 +0200 Subject: [PATCH] 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. Change-Id: I5f70c072e609337b39064ba48353b4fdf23acf17 Reviewed-on: http://gerrit.openafs.org/11185 Reviewed-by: D Brashear Tested-by: BuildBot --- src/venus/fstrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/venus/fstrace.c b/src/venus/fstrace.c index 4b8207f92..47f626919 100644 --- a/src/venus/fstrace.c +++ b/src/venus/fstrace.c @@ -223,7 +223,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; -- 2.39.5