diff options
author | Steven Rostedt <[email protected]> | 2009-10-20 19:19:35 -0400 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2009-10-21 13:39:57 +0200 |
commit | 4e3b799d7dbb2a12ca8dca8d3594d32095772973 (patch) | |
tree | 784404eadda2611489b1fec26d42cd2563d7d407 /tools/perf/scripts/python/check-perf-trace.py | |
parent | 60d526f7fa6246b8e32d5b45610d625a5608d988 (diff) |
perf tools: Use strsep() over strtok_r() for parsing single line
The second argument in the strtok_r() function is not to be used
generically and can have different implementations. Currently
the function parsing of the perf trace code uses the second
argument to copy data from. This can crash the tool or just have
unpredictable results.
The correct solution is to use strsep() which has a defined
result.
I also added a check to see if the result was correct, and will
break out of the loop in case it fails to parse as expected.
Reported-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/check-perf-trace.py')
0 files changed, 0 insertions, 0 deletions