mirror of
https://github.com/adulau/aha.git
synced 2024-12-30 20:56:23 +00:00
perf_counter tools: fix buffer overwrite problem for perf top command
There is a buffer overwrite problem in builtin-top.c line 526, When I tried to use ./perf top command, it was giving memory corruption problem. [ Impact: fix 'perf top' crash ] LKML-Reference: <3fee128b0905092313x608e65e0l7b1116d86914114f@mail.gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
f15b18d075
commit
82afae6016
1 changed files with 1 additions and 1 deletions
|
@ -523,7 +523,7 @@ static int read_symbol(FILE *in, struct sym_entry *s)
|
||||||
if (strstr(sym, "_text_start") || strstr(sym, "_text_end"))
|
if (strstr(sym, "_text_start") || strstr(sym, "_text_end"))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
s->sym = malloc(strlen(str));
|
s->sym = malloc(strlen(str)+1);
|
||||||
assert(s->sym);
|
assert(s->sym);
|
||||||
|
|
||||||
strcpy((char *)s->sym, str);
|
strcpy((char *)s->sym, str);
|
||||||
|
|
Loading…
Reference in a new issue