Skip to content

Commit

Permalink
perf_counter tools: fix buffer overwrite problem for perf top command
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Erdem Aktas authored and Ingo Molnar committed May 10, 2009
1 parent f15b18d commit 82afae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/perf_counter/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static int read_symbol(FILE *in, struct sym_entry *s)
if (strstr(sym, "_text_start") || strstr(sym, "_text_end"))
return 1;

s->sym = malloc(strlen(str));
s->sym = malloc(strlen(str)+1);
assert(s->sym);

strcpy((char *)s->sym, str);
Expand Down

0 comments on commit 82afae6

Please sign in to comment.