diff options
author | Mark Wielaard <mark@klomp.org> | 2018-06-08 02:11:44 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2018-06-10 11:03:31 +0200 |
commit | c5fdb8e5e0be9a507766a58f3c27c57703f369a9 (patch) | |
tree | 2ae1bc365feec1b904e07e12e74d2bb709fc663e /libdw/dwarf_end.c | |
parent | 725bcd0a0acc9736e4d6312ccb630f98a0fea1a9 (diff) | |
download | elfutils-c5fdb8e5e0be9a507766a58f3c27c57703f369a9.tar.gz |
libdw: Return an error in dwarf_getlocation_attr for missing .debug_addr.
When constructing a "fake" Dwarf_Attribute for DW_OP_GNU_const_index,
DW_OP_constx, DW_OP_GNU_addr_index or DW_OP_addrx, we would create a
fake attribute pointing to the actual data in the .debug_addr section.
We would even do that if there was no .debug_addr section assuming
dwarf_formaddr or dwarf_formudata would generate an error. But when
there is no .debug_addr there is also no fake_addr_cu, so the
dwarf_form* functions cannot check the value is correct (and crash).
Fix by returning an error early from dwarf_getlocation_attr indicating
bad DWARF data.
Found by the afl fuzzer running on the varlocs testcase.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libdw/dwarf_end.c')
0 files changed, 0 insertions, 0 deletions