* PR26453 UBSAN: som.c:2885 null pointer memcpy
@ 2020-08-26 13:48 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2020-08-26 13:48 UTC (permalink / raw)
To: binutils
PR 26453
* som.c (som_prep_for_fixups): Return early when no symbols.
diff --git a/bfd/som.c b/bfd/som.c
index 4f0a606c18..93a0ad89d5 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -2804,6 +2804,9 @@ som_prep_for_fixups (bfd *abfd, asymbol **syms, unsigned long num_syms)
asymbol **sorted_syms;
size_t amt;
+ if (num_syms == 0)
+ return TRUE;
+
/* Most SOM relocations involving a symbol have a length which is
dependent on the index of the symbol. So symbols which are
used often in relocations should have a small index. */
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-26 13:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 13:48 PR26453 UBSAN: som.c:2885 null pointer memcpy Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).