diff options
| author | Benjamin Gray <[email protected]> | 2023-02-03 11:39:45 +1100 |
|---|---|---|
| committer | Michael Ellerman <[email protected]> | 2023-02-09 23:56:45 +1100 |
| commit | d1bc05b7bf02f8635fe6c445f67d78f85234cbb7 (patch) | |
| tree | 85d9bd4f50840b97852992c69db196f6120e51f0 /tools/perf/scripts/python/flamegraph.py | |
| parent | 121d340be9a17ed89d523c56203908c01e09a306 (diff) | |
selftests/powerpc: Parse long/unsigned long value safely
Often a file is expected to hold an integral value. Existing functions
will use a C stdlib function like atoi or strtol to parse the file.
These operations are error prone, with complicated error conditions
(atoi returns 0 if not a number, and is undefined behaviour if not in
range. strtol returns 0 if not a number, and LONG_MIN/MAX if not in
range + sets errno to ERANGE).
Signed-off-by: Benjamin Gray <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions