projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0ad09c
)
asan: null deref in coff_write_relocs
author
Alan Modra
<amodra@gmail.com>
Thu, 2 Jun 2022 07:01:42 +0000
(16:31 +0930)
committer
Alan Modra
<amodra@gmail.com>
Thu, 2 Jun 2022 07:01:42 +0000
(16:31 +0930)
* coffcode.h (coff_write_relocs): Don't deref NULL howto.
bfd/coffcode.h
patch
|
blob
|
history
diff --git
a/bfd/coffcode.h
b/bfd/coffcode.h
index 36e07025c6a370b3c13ffc79f70985ae50257b3f..6de6ecdea39a1c95b19b30760788f5a107aef759 100644
(file)
--- a/
bfd/coffcode.h
+++ b/
bfd/coffcode.h
@@
-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);