mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-08 16:43:19 +00:00
Fix an illegal memory access triggered by an attempt to parse a corrupt input file.
PR 28046 * dwarf2.c (read_ranges): Check that range_ptr does not exceed range_end.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2021-07-02 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR 28046
|
||||||
|
* dwarf2.c (read_ranges): Check that range_ptr does not exceed
|
||||||
|
range_end.
|
||||||
|
|
||||||
2021-06-30 YunQiang Su <yunqiang.su@cipunited.com>
|
2021-06-30 YunQiang Su <yunqiang.su@cipunited.com>
|
||||||
|
|
||||||
PR mips/28009
|
PR mips/28009
|
||||||
|
|||||||
@@ -909,7 +909,8 @@ read_address (struct comp_unit *unit, bfd_byte **ptr, bfd_byte *buf_end)
|
|||||||
if (bfd_get_flavour (unit->abfd) == bfd_target_elf_flavour)
|
if (bfd_get_flavour (unit->abfd) == bfd_target_elf_flavour)
|
||||||
signed_vma = get_elf_backend_data (unit->abfd)->sign_extend_vma;
|
signed_vma = get_elf_backend_data (unit->abfd)->sign_extend_vma;
|
||||||
|
|
||||||
if (unit->addr_size > (size_t) (buf_end - buf))
|
if (unit->addr_size > (size_t) (buf_end - buf)
|
||||||
|
|| (buf > buf_end))
|
||||||
{
|
{
|
||||||
*ptr = buf_end;
|
*ptr = buf_end;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3097,6 +3098,8 @@ read_ranges (struct comp_unit *unit, struct arange *arange,
|
|||||||
if (ranges_ptr < unit->file->dwarf_ranges_buffer)
|
if (ranges_ptr < unit->file->dwarf_ranges_buffer)
|
||||||
return false;
|
return false;
|
||||||
ranges_end = unit->file->dwarf_ranges_buffer + unit->file->dwarf_ranges_size;
|
ranges_end = unit->file->dwarf_ranges_buffer + unit->file->dwarf_ranges_size;
|
||||||
|
if (ranges_ptr >= ranges_end)
|
||||||
|
return false;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user