diff options
| author | Alex Elder <[email protected]> | 2012-10-04 17:13:16 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2012-10-06 03:04:56 +0900 |
| commit | 77dd3b0bd17a0849b2f98b915ce3fc9247db1013 (patch) | |
| tree | a6ff9f120d790b5559e3f91cf9849e9f84ee1e65 /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | 125c4c706b680c7831f0966ff873c1ad0354ec25 (diff) | |
lib/parser.c: avoid overflow in match_number()
The result of converting an integer value to another signed integer type
that's unable to represent the original value is implementation defined.
(See notes in section 6.3.1.3 of the C standard.)
In match_number(), the result of simple_strtol() (which returns type long)
is assigned to a value of type int.
Instead, handle the result of simple_strtol() in a well-defined way, and
return -ERANGE if the result won't fit in the int variable used to hold
the parsed result.
No current callers pay attention to the particular error value returned,
so this additional return code shouldn't do any harm.
[[email protected]: coding-style tweaks]
Signed-off-by: Alex Elder <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions