]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix a potential illegal memory access in the BFD library when parsing a corrupt DWARF...
authorNick Clifton <nickc@redhat.com>
Wed, 11 Jan 2023 12:13:46 +0000 (12:13 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 11 Jan 2023 12:13:46 +0000 (12:13 +0000)
PR 29988
* dwarf2.c (read_indexed_address): Fix check for an out of range
offset.

bfd/ChangeLog
bfd/dwarf2.c

index f5b5b663d26b8b7af0b6eb637e80ead5cdc3c581..c2a8dc6e934dbcf8ab76e1ffd166e6c488198155 100644 (file)
@@ -1,3 +1,9 @@
+2023-01-11  Nick Clifton  <nickc@redhat.com>
+
+       PR 29988
+       * dwarf2.c (read_indexed_address): Fix check for an out of range
+       offset.
+
 2023-01-06  Nick Clifton  <nickc@redhat.com>
 
        * po/ru.po: Updated Russian translation.
index 6eb6e04e6e5b1386c2a99bc65becf8680ada4176..4ec0053a11154276271a22e03db4f3da32331726 100644 (file)
@@ -1412,7 +1412,7 @@ read_indexed_address (uint64_t idx, struct comp_unit *unit)
   offset += unit->dwarf_addr_offset;
   if (offset < unit->dwarf_addr_offset
       || offset > file->dwarf_addr_size
-      || file->dwarf_addr_size - offset < unit->offset_size)
+      || file->dwarf_addr_size - offset < unit->addr_size)
     return 0;
 
   info_ptr = file->dwarf_addr_buffer + offset;