aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-08-02 07:43:11 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-04 05:09:56 -0400
commit7e030655dda5b5efc4305e2a8f46c4967d32eb3d (patch)
tree76afe22fedb4914718b8962f86203d8a06ff166d /tools/perf/builtin-report.c
parent59b9005692d4c8b5d73cfc41aa7229f47be163a9 (diff)
perf: Fix read buffer overflow
Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: a.p.zijlstra@chello.nl Cc: Andrew Morton <akpm@linux-foundation.org> LKML-Reference: <4A757BCF.40101@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 95fd06cdaa99..ce4f28645e64 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -253,7 +253,7 @@ static int strcommon(const char *pathname)
253{ 253{
254 int n = 0; 254 int n = 0;
255 255
256 while (pathname[n] == cwd[n] && n < cwdlen) 256 while (n < cwdlen && pathname[n] == cwd[n])
257 ++n; 257 ++n;
258 258
259 return n; 259 return n;