Commit 11ae63de authored by Eric Dumazet's avatar Eric Dumazet Committed by Greg Kroah-Hartman

perf tools: Fix buffer allocation

commit a255a998 upstream.

"perf top" cores dump on my dev machine, if run from a directory
where vmlinux is present:

  *** glibc detected *** malloc(): memory corruption: 0x085670d0 ***
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
LKML-Reference: <4ABB6EB7.7000002@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 45bc2584
......@@ -422,7 +422,7 @@ static int mod_dso__load_module_paths(struct mod_dso *self)
len += strlen(uts.release);
len += strlen("/modules.dep");
path = calloc(1, len);
path = calloc(1, len + 1);
if (path == NULL)
goto out_failure;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment