summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog1
-rw-r--r--src/readelf.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 112af191..576ed83f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -2,6 +2,7 @@
* readelf.c (print_debug_line_section): Correct overflow check for
unit_length.
+ (print_debug_aranges_section): Correct overflow check for length.
2014-12-15 Mark Wielaard <[email protected]>
diff --git a/src/readelf.c b/src/readelf.c
index 3c686d5c..9c62853e 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -4711,7 +4711,7 @@ print_debug_aranges_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
printf (gettext ("\n Length: %6" PRIu64 "\n"),
(uint64_t) length);
- if (unlikely ((ptrdiff_t) length > readendp - readp))
+ if (unlikely (length > (size_t) (readendp - readp)))
goto invalid_data;
if (length == 0)