From: Mark Wielaard Date: Tue, 5 Jun 2018 20:50:43 +0000 (+0200) Subject: readelf: Set begin properly for DW_LLE_GNU_start_end_entry on addrx failure. X-Git-Tag: elfutils-0.172~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=090ef3e03c884d4d936129c4cffaa73cd57d4c7f;p=thirdparty%2Felfutils.git readelf: Set begin properly for DW_LLE_GNU_start_end_entry on addrx failure. When printing the GNU DebugFission location entries we want to print the start idx as begin, if we cannot find the address index. A copy/paste error set up end instead of begin in that case causing us to print garbage (in the unlikely event the .debug_addr table wasn't found for this entry). Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index 65f9dc772..c0ac41819 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2018-06-05 Mark Wielaard + + * readelf.c (print_debug_loc_section): Set begin to idx when failing + to read the start address if DW_LLE_GNU_start_end_entry. + 2018-06-05 Mark Wielaard * readelf.c (handle_sysv_hash): Don't leak lengths array when diff --git a/src/readelf.c b/src/readelf.c index 233312fe3..68a664d58 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -9343,7 +9343,7 @@ print_debug_loc_section (Dwfl_Module *dwflmod, goto invalid_data; get_uleb128 (idx, locp, locendp); if (get_indexed_addr (cu, idx, &begin) != 0) - end = idx; /* ... */ + begin = idx; /* ... */ if (locp >= locendp) goto invalid_data; get_uleb128 (idx, locp, locendp);