summaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-12-15 11:35:46 +0100
committerMark Wielaard <[email protected]>2014-12-17 16:43:27 +0100
commitb171ca4f135f6e4ec894e18aff4d507c1430f86a (patch)
tree5badf50664549ca712aa06ee4149a2790027222b /src/readelf.c
parent9520242b2ab23a3e713f2b7d1a968777feb06bfa (diff)
readelf: Check there is enough room for the DW_LNE_set_address argument
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 51ce0202..faaa6d1b 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6609,6 +6609,8 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
case DW_LNE_set_address:
op_index = 0;
+ if (unlikely ((size_t) (lineendp - linep) < address_size))
+ goto invalid_unit;
if (address_size == 4)
address = read_4ubyte_unaligned_inc (dbg, linep);
else