]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: Check there is enough room for the DW_LNE_set_address argument
authorMark Wielaard <mjw@redhat.com>
Mon, 15 Dec 2014 10:35:46 +0000 (11:35 +0100)
committerMark Wielaard <mjw@redhat.com>
Wed, 17 Dec 2014 15:43:27 +0000 (16:43 +0100)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
src/ChangeLog
src/readelf.c

index dc4377f34b0635e965f28a1cf358ccc65991d54b..e36bb918a6ea5874d2d1e16c753fa988a96fd4a9 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-15  Mark Wielaard  <mjw@redhat.com>
+
+       * readelf.c (print_debug_line_section): Check there is enough room
+       for DW_LNE_set_address argument.
+
 2014-12-14  Mark Wielaard  <mjw@redhat.com>
 
        * elflint.c (check_attributes): Call get_uleb128 with end pointer.
index 51ce0202960a8f60e818cfc04831ee2c416431c3..faaa6d1b9df59f34f05f2455ad55f756c6372751 100644 (file)
@@ -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