Pointer range checking is UB if the values compared are outside the
underlying array elements (plus one).
* dwarf2.c (read_address): Remove accidental commit.
(read_ranges): Compare offset rather than pointers.
+2021-07-10 Alan Modra <amodra@gmail.com>
+
+ * dwarf2.c (read_address): Remove accidental commit.
+ (read_ranges): Compare offset rather than pointers.
+
2021-07-08 Nick Clifton <nickc@redhat.com>
* po/pt.po: Updated Portuguese translation.
if (bfd_get_flavour (unit->abfd) == bfd_target_elf_flavour)
signed_vma = get_elf_backend_data (unit->abfd)->sign_extend_vma;
- if (unit->addr_size > (size_t) (buf_end - buf)
- || (buf > buf_end))
+ if (unit->addr_size > (size_t) (buf_end - buf))
{
*ptr = buf_end;
return 0;
return false;
}
- ranges_ptr = unit->file->dwarf_ranges_buffer + offset;
- if (ranges_ptr < unit->file->dwarf_ranges_buffer)
+ if (offset > unit->file->dwarf_ranges_size)
return false;
+ ranges_ptr = unit->file->dwarf_ranges_buffer + offset;
ranges_end = unit->file->dwarf_ranges_buffer + unit->file->dwarf_ranges_size;
- if (ranges_ptr >= ranges_end)
- return false;
for (;;)
{