提交 a255a998 编写于 作者: E Eric Dumazet 提交者: Ingo Molnar

perf tools: Fix buffer allocation

"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: NEric Dumazet <eric.dumazet@gmail.com>
Cc: <stable@kernel.org>
LKML-Reference: <4ABB6EB7.7000002@gmail.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 67030036
...@@ -423,7 +423,7 @@ static int mod_dso__load_module_paths(struct mod_dso *self) ...@@ -423,7 +423,7 @@ static int mod_dso__load_module_paths(struct mod_dso *self)
len += strlen(uts.release); len += strlen(uts.release);
len += strlen("/modules.dep"); len += strlen("/modules.dep");
dpath = calloc(1, len); dpath = calloc(1, len + 1);
if (dpath == NULL) if (dpath == NULL)
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册