]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: elf_strptr should fetch the shdr for the section if not yet known.
authorMark Wielaard <mjw@redhat.com>
Tue, 20 Jan 2015 13:52:41 +0000 (14:52 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 6 Feb 2015 21:18:52 +0000 (22:18 +0100)
commit058ae7b4d5bdfa0f39312b056ee9cadc4c3ffeb9
treebb41cd47b381b0d698ff2e5ef96dfbce635e02a4
parentc806736dc8ba24bf126d3942aaa755e7d4f86ea9
libelf: elf_strptr should fetch the shdr for the section if not yet known.

elf_strptr might be called before the shdrs are read in. In that case it
needs to explicitly call __elf[32|64]_getshdr_rdlock to check the section
type and size. The new strptr testcase triggers this corner case and crashes
before the fix.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libelf/ChangeLog
libelf/elf_strptr.c
tests/ChangeLog
tests/Makefile.am
tests/run-strptr.sh [new file with mode: 0755]
tests/strptr.c [new file with mode: 0644]