mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
PR28403, null pointer dereference in disassemble_bytes
Indexing of symbol and howto arrays wasn't checked in aout targets. PR 28403 * aout-ns32k.c (MY (reloc_howto)): Sanity check howto_table index. Make r_index unsigned. (MY_swap_std_reloc_in): Make r_index unsigned. * aoutx.h (MOVE_ADDRESS): Sanity check symbol r_index. (aout_link_input_section_std): Make r_index unsigned. (aout_link_input_section_ext): Likewise. * i386lynx.c (MOVE_ADDRESS): Sanity check symbol r_index. (swap_ext_reloc_in, swap_std_reloc_in): Make r_index unsigned. * pdp11.c (MOVE_ADDRESS): Sanity check symbol r_index.
This commit is contained in:
@ -1862,7 +1862,8 @@ pdp11_aout_swap_reloc_out (bfd *abfd, arelent *g, bfd_byte *natptr)
|
||||
if (r_extern) \
|
||||
{ \
|
||||
/* Undefined symbol. */ \
|
||||
cache_ptr->sym_ptr_ptr = symbols + r_index; \
|
||||
if (r_index < bfd_get_symcount (abfd)) \
|
||||
cache_ptr->sym_ptr_ptr = symbols + r_index; \
|
||||
cache_ptr->addend = ad; \
|
||||
} \
|
||||
else \
|
||||
|
Reference in New Issue
Block a user