From 702993956f7e6937591e3b8accd8aab2cd1baafa Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Fri, 10 Aug 2012 15:22:55 -0700 Subject: [PATCH] --- yaml --- r: 323680 b: refs/heads/master c: 492746546fe380da768c8496213e26aa91b9b3aa h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/util/symbol-elf.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 1e26d260308b..30d71bb9683a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 515850e4fbd87c8f249446faa2e5ad98e672711d +refs/heads/master: 492746546fe380da768c8496213e26aa91b9b3aa diff --git a/trunk/tools/perf/util/symbol-elf.c b/trunk/tools/perf/util/symbol-elf.c index a2e994e2605f..a9a194d49c1b 100644 --- a/trunk/tools/perf/util/symbol-elf.c +++ b/trunk/tools/perf/util/symbol-elf.c @@ -129,6 +129,10 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, Elf_Scn *sec = NULL; size_t cnt = 1; + /* Elf is corrupted/truncated, avoid calling elf_strptr. */ + if (!elf_rawdata(elf_getscn(elf, ep->e_shstrndx), NULL)) + return NULL; + while ((sec = elf_nextscn(elf, sec)) != NULL) { char *str;