diff options
author | Colin Ian King <[email protected]> | 2018-03-14 17:33:54 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2018-03-16 13:56:44 -0300 |
commit | 66790bc8e1f51831d73691954ae0b430bde614ad (patch) | |
tree | 4d35c363dc169b453528d09ebca804129e99166b /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | 6810158d526e483868e519befff407b91e76b3db (diff) |
perf tests: Fix out of bounds access on array fd when cnt is 100
Currently when cnt is 100 an array bounds overflow occurs on the
assignment of fd[cnt]. Fix this by performing the bounds check on cnt
before writing to fd.
Detected by cppcheck:
tools/perf/tests/bp_account.c:115: (warning) Either the condition
'cnt==100' is redundant or the array 'fd[100]' is accessed at index 100,
which is out of bounds.
Signed-off-by: Colin King <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Fixes: 032db28e5fa3 ("perf tests: Add breakpoint accounting/modify test")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions