From: Mark Wielaard Date: Mon, 15 Dec 2014 10:35:46 +0000 (+0100) Subject: readelf: Check there is enough room for the DW_LNE_set_address argument X-Git-Tag: elfutils-0.161~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b171ca4f135f6e4ec894e18aff4d507c1430f86a;p=thirdparty%2Felfutils.git readelf: Check there is enough room for the DW_LNE_set_address argument Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index dc4377f34..e36bb918a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-12-15 Mark Wielaard + + * readelf.c (print_debug_line_section): Check there is enough room + for DW_LNE_set_address argument. + 2014-12-14 Mark Wielaard * elflint.c (check_attributes): Call get_uleb128 with end pointer. diff --git a/src/readelf.c b/src/readelf.c index 51ce02029..faaa6d1b9 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