From: Nick Clifton Date: Wed, 11 Jan 2023 12:13:46 +0000 (+0000) Subject: Fix a potential illegal memory access in the BFD library when parsing a corrupt DWARF... X-Git-Tag: binutils-2_40~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e307d538c351aa9327cbad672c884059ecc20dd;p=thirdparty%2Fbinutils-gdb.git Fix a potential illegal memory access in the BFD library when parsing a corrupt DWARF file. PR 29988 * dwarf2.c (read_indexed_address): Fix check for an out of range offset. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f5b5b663d26..c2a8dc6e934 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2023-01-11 Nick Clifton + + PR 29988 + * dwarf2.c (read_indexed_address): Fix check for an out of range + offset. + 2023-01-06 Nick Clifton * po/ru.po: Updated Russian translation. diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 6eb6e04e6e5..4ec0053a111 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -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;