summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-06-05 22:50:43 +0200
committerMark Wielaard <[email protected]>2018-06-08 12:03:14 +0200
commit090ef3e03c884d4d936129c4cffaa73cd57d4c7f (patch)
treeee8f9faa68bd43d7777c6c2e0ef10717018fbcc8 /src
parentab92149d354207f55e912c264a72a258f0132e02 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/readelf.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 65f9dc77..c0ac4181 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2018-06-05 Mark Wielaard <[email protected]>
+ * 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 <[email protected]>
+
* readelf.c (handle_sysv_hash): Don't leak lengths array when
detecting an invalid chain.
(handle_sysv_hash64): Likewise.
diff --git a/src/readelf.c b/src/readelf.c
index 233312fe..68a664d5 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);