summaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-12-15 13:40:18 +0100
committerMark Wielaard <[email protected]>2014-12-17 16:43:28 +0100
commit9c42b782ebf32e88d922733b6666ef4b026d760c (patch)
tree6aa008d8d0c34a4c19c875546598e6f9ab4e0eb8 /src/readelf.c
parentb171ca4f135f6e4ec894e18aff4d507c1430f86a (diff)
readelf: Make sure there is enough room for reading .debug_line unit_length.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src/readelf.c')
-rw-r--r--src/readelf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/readelf.c b/src/readelf.c
index faaa6d1b..cd8ba869 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6333,6 +6333,8 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
printf (gettext ("\nTable at offset %Zu:\n"), start_offset);
+ if (unlikely (linep + 4 > lineendp))
+ goto invalid_data;
Dwarf_Word unit_length = read_4ubyte_unaligned_inc (dbg, linep);
unsigned int length = 4;
if (unlikely (unit_length == 0xffffffff))