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.
This commit is contained in:
Nick Clifton
2023-01-11 12:12:25 +00:00
parent f1e1932859
commit 11d171f191
2 changed files with 7 additions and 1 deletions

View 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.

View File

@ -1420,7 +1420,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;