diff options
| author | Kaige Ye <[email protected]> | 2023-08-04 02:09:08 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2023-08-21 13:54:22 +0000 |
| commit | 58a8d2edd57b35307d81ec6c304697707e6067c1 (patch) | |
| tree | bca704cb6ac07d38f03ee4ab6475b77489a02e23 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | perf bpf augmented_raw_syscalls: Add an assert to make sure sizeof(augmented_... (diff) | |
| download | kernel-58a8d2edd57b35307d81ec6c304697707e6067c1.tar.gz kernel-58a8d2edd57b35307d81ec6c304697707e6067c1.zip | |
perf stat-display: Check if snprintf()'s fmt argument is NULL
It is undefined behavior to pass NULL as snprintf()'s fmt argument.
Here is an example to trigger the problem:
$ perf stat --metric-only -x, -e instructions -- sleep 1
insn per cycle,
Segmentation fault (core dumped)
With this patch:
$ perf stat --metric-only -x, -e instructions -- sleep 1
insn per cycle,
,
Reviewed-by: Ian Rogers <[email protected]>
Signed-off-by: Kaige Ye <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
