diff options
author | Erdem Aktas <eaktas1@gmail.com> | 2009-05-10 02:13:19 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-10 02:21:18 -0400 |
commit | 82afae6016b672acb90ceb8e773bba0bd977d2a3 (patch) | |
tree | b3ae274679fa300bf5fbb72822d0742e9cba780e /Documentation | |
parent | f15b18d0755b3ee4b29991fc2fde535ee41df53c (diff) |
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>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/perf_counter/builtin-top.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c index cd6f61d73418..b1549dd27720 100644 --- a/Documentation/perf_counter/builtin-top.c +++ b/Documentation/perf_counter/builtin-top.c | |||
@@ -523,7 +523,7 @@ static int read_symbol(FILE *in, struct sym_entry *s) | |||
523 | if (strstr(sym, "_text_start") || strstr(sym, "_text_end")) | 523 | if (strstr(sym, "_text_start") || strstr(sym, "_text_end")) |
524 | return 1; | 524 | return 1; |
525 | 525 | ||
526 | s->sym = malloc(strlen(str)); | 526 | s->sym = malloc(strlen(str)+1); |
527 | assert(s->sym); | 527 | assert(s->sym); |
528 | 528 | ||
529 | strcpy((char *)s->sym, str); | 529 | strcpy((char *)s->sym, str); |