From cb1c5ddb307db2d4f7a9e3e9627b8576fc1aa9e5 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 2 Mar 2013 11:49:13 +0000 Subject: [PATCH] fstrace: Don't read uninitialised data 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 Tested-by: BuildBot Reviewed-by: Jeffrey Altman (cherry picked from commit 908105fe8d51551e45692de4e145022138a0356c) Change-Id: I2dec4dc3b041093e1d1ac2ea4546a341e9b00687 Reviewed-on: http://gerrit.openafs.org/11053 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Stephan Wiesand --- 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 b677431c4..4c3d3e097 100644 --- a/src/venus/fstrace.c +++ b/src/venus/fstrace.c @@ -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 */ -- 2.39.5