summaryrefslogtreecommitdiff
path: root/tools/perf/util/trace-event-read.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/trace-event-read.c')
-rw-r--r--tools/perf/util/trace-event-read.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
index 342dfdd43f8..1744422cafc 100644
--- a/tools/perf/util/trace-event-read.c
+++ b/tools/perf/util/trace-event-read.c
@@ -145,8 +145,9 @@ static void read_proc_kallsyms(void)
if (!size)
return;
- buf = malloc_or_die(size);
+ buf = malloc_or_die(size + 1);
read_or_die(buf, size);
+ buf[size] = '\0';
parse_proc_kallsyms(buf, size);