lkml.org 
[lkml]   [2009]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[030/136] perf tools: Fix buffer allocation
2.6.31-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Eric Dumazet <eric.dumazet@gmail.com>

commit a255a9981a8566a1efabec983b7811e937e662d2 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: Eric Dumazet <eric.dumazet@gmail.com>
LKML-Reference: <4ABB6EB7.7000002@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
tools/perf/util/module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/perf/util/module.c
+++ b/tools/perf/util/module.c
@@ -422,7 +422,7 @@ static int mod_dso__load_module_paths(st
len += strlen(uts.release);
len += strlen("/modules.dep");

- path = calloc(1, len);
+ path = calloc(1, len + 1);
if (path == NULL)
goto out_failure;




\
 
 \ /
  Last update: 2009-10-02 04:15    [W:0.306 / U:1.740 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site