forked from Imagelibrary/binutils-gdb
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user