mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-13 02:45:02 +08:00
asan: null deref in coff_write_relocs
* coffcode.h (coff_write_relocs): Don't deref NULL howto.
This commit is contained in:
@ -2690,9 +2690,11 @@ coff_write_relocs (bfd * abfd, int first_undef)
|
||||
|
||||
#ifdef SELECT_RELOC
|
||||
/* Work out reloc type from what is required. */
|
||||
SELECT_RELOC (n, q->howto);
|
||||
if (q->howto)
|
||||
SELECT_RELOC (n, q->howto);
|
||||
#else
|
||||
n.r_type = q->howto->type;
|
||||
if (q->howto)
|
||||
n.r_type = q->howto->type;
|
||||
#endif
|
||||
coff_swap_reloc_out (abfd, &n, &dst);
|
||||
|
||||
|
Reference in New Issue
Block a user