diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-26 17:58:40 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-26 23:23:44 +0930 |
commit | 66ad6b4458091b6bb7fbc327308ceabaaba02e8b (patch) | |
tree | a4dc0f8fa2a1b7b0aa1894c5bca04aefde6fa3c6 /bfd/som.c | |
parent | d8d6da137d7ececcd0e10c575aa187bb8c9b24e0 (diff) | |
download | gdb-66ad6b4458091b6bb7fbc327308ceabaaba02e8b.zip gdb-66ad6b4458091b6bb7fbc327308ceabaaba02e8b.tar.gz gdb-66ad6b4458091b6bb7fbc327308ceabaaba02e8b.tar.bz2 |
PR26453 UBSAN: som.c:2885 null pointer memcpy
PR 26453
* som.c (som_prep_for_fixups): Return early when no symbols.
Diffstat (limited to 'bfd/som.c')
-rw-r--r-- | bfd/som.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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. */ |