]> git.ipfire.org Git - thirdparty/elfutils.git/commit
backends: Check type DIE exists before calling dwarf_tag ().
authorMark Wielaard <mjw@redhat.com>
Wed, 6 Feb 2013 12:15:10 +0000 (13:15 +0100)
committerMark Wielaard <mjw@redhat.com>
Wed, 6 Feb 2013 22:27:03 +0000 (23:27 +0100)
commit1d5037f725b691929396896fd2b6be3cae1d87ef
treeefa4f61691eb0d74b6dae5ceb4b3901282420741
parent6c4b2078c51c687a1a192b001f0b331a0ccac629
backends: Check type DIE exists before calling dwarf_tag ().

dwarf_attr () or dwarf_form () functions leave typedie NULL when they fail
because of missing attribute or unexpected form. In such cases first check
the DIE exists and return error instead of calling dwarf_tag () and crashing.

This also happens in the testsuite with native tests when elfutils is build
without DWZ support on a distro that uses DWZ DWARF compression on system
libraries. Only the backends used dwarf_tag () directly without checking,
all other uses in elfutils already checked whether the given DIE was NULL.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
13 files changed:
backends/ChangeLog
backends/alpha_retval.c
backends/arm_retval.c
backends/i386_retval.c
backends/ia64_retval.c
backends/libebl_CPU.h
backends/ppc64_retval.c
backends/ppc_retval.c
backends/s390_retval.c
backends/sh_retval.c
backends/sparc_retval.c
backends/tilegx_retval.c
backends/x86_64_retval.c