summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/readelf.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 00a587cd..7203dd95 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2014-12-20 Mark Wielaard <[email protected]>
+ * readelf.c (print_debug_macinfo_section): Mark cus sentinel files
+ as -1 non-existent. Check macoff against sentinel cus.
+
+2014-12-20 Mark Wielaard <[email protected]>
+
* readelf.c (print_debug_exception_table): Add max_action overflow
check. Check action_table_end before reading slib128. Check
max_ar_filter underflow.
diff --git a/src/readelf.c b/src/readelf.c
index a05b2382..237975f9 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -7061,6 +7061,7 @@ print_debug_macinfo_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
* sizeof (*cus));
/* Add sentinel. */
cus[nculist].offset = data->d_size;
+ cus[nculist].files = (Dwarf_Files *) -1l;
if (nculist > 0)
{
for (size_t cnt = nculist - 1; culist != NULL; --cnt)
@@ -7136,7 +7137,7 @@ print_debug_macinfo_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
const char *fname = "???";
if (macoff >= cus[0].offset)
{
- while (macoff >= cus[1].offset)
+ while (macoff >= cus[1].offset && cus[1].offset != data->d_size)
++cus;
if (cus[0].files == NULL