diff options
| author | Alan Modra <amodra@gmail.com> | 2026-04-23 15:08:37 +0930 |
|---|---|---|
| committer | Alan Modra <amodra@gmail.com> | 2026-04-23 20:13:25 +0930 |
| commit | 8dc535c59fdbcf99e28703425e5c1c711e63a1f1 (patch) | |
| tree | 49b85b4367e78b8852bb35283cf4fa74081295e9 /bfd | |
| parent | 0a481bb9a6d49591a7f21b132ff63a96704bce97 (diff) | |
| download | fsf-binutils-gdb-8dc535c59fdbcf99e28703425e5c1c711e63a1f1.tar.gz fsf-binutils-gdb-8dc535c59fdbcf99e28703425e5c1c711e63a1f1.tar.bz2 fsf-binutils-gdb-8dc535c59fdbcf99e28703425e5c1c711e63a1f1.zip | |
asan: unknown write in z80_elf_16_be_reloc
* elf32-z80.c (z80_elf_16_be_reloc): Sanity check reloc offset.
Diffstat (limited to 'bfd')
| -rw-r--r-- | bfd/elf32-z80.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf32-z80.c b/bfd/elf32-z80.c index 8eacfd7e464..1dc2e192adc 100644 --- a/bfd/elf32-z80.c +++ b/bfd/elf32-z80.c @@ -580,6 +580,10 @@ z80_elf_16_be_reloc (bfd *abfd, return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); + if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd, + input_section, octets)) + return bfd_reloc_outofrange; + /* Get symbol value. */ val = 0; if (!bfd_is_com_section (symbol->section)) |
