From e9e64f6748499d458b951e0dcd46d6cc9d850886 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 20 May 2018 21:57:39 +0200 Subject: 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 --- src/ChangeLog | 5 +++++ src/readelf.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 545fb503..b6f66bdd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2018-05-28 Mark Wielaard + + * readelf.c (print_debug_units): Turn "Could not find split compile + unit" into an Warning instead of an error. + 2018-04-29 Mark Wielaard * readelf.c (parse_opt): Request implicit section_info for "str". diff --git a/src/readelf.c b/src/readelf.c index be9fe88c..bfa1d16d 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -7668,7 +7668,7 @@ print_debug_units (Dwfl_Module *dwflmod, || dwarf_tag (&subdie) == DW_TAG_invalid) { if (!silent) - error (0, 0, gettext ("Could not find split compile unit")); + fprintf (stderr, gettext ("Could not find split compile unit")); } else { -- cgit v1.2.3