libdw: Fix memory corruption in libdw_find_split_unit.
authorMark Wielaard <mark@klomp.org>
Sun, 20 May 2018 19:57:39 +0000 (21:57 +0200)
committerMark Wielaard <mark@klomp.org>
Wed, 30 May 2018 12:56:28 +0000 (14:56 +0200)
commite9e64f6748499d458b951e0dcd46d6cc9d850886
treec2b0538445c6eae69f1b2de46463415feb4f9d06
parent4ac4a42376428248f7174c7bb713fff27bb4d4b0
libdw: Fix memory corruption in libdw_find_split_unit.

Found by valgrind when trying to match a split unit from a .dwo file
that doesn't contain the split unit (as first) match. We would close
the split Dwarf too early, before we had inspected all units in it.

Add a testcase that simulates this. Which failed (at least under valgrind
as run by make distcheck) before the fix.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/ChangeLog
libdw/libdw_find_split_unit.c
src/ChangeLog
src/readelf.c
tests/ChangeLog
tests/Makefile.am
tests/run-readelf-info-plus.sh [new file with mode: 0755]