mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-17 21:03:55 +08:00
PR26478 UBSAN: mmo.c:2941 null pointer memcpy
PR 26478 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2020-08-26 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 26478
|
||||
* mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
|
||||
|
||||
2020-08-26 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 26475
|
||||
|
@ -2938,7 +2938,8 @@ mmo_write_symbols_and_terminator (bfd *abfd)
|
||||
if (table == NULL)
|
||||
return FALSE;
|
||||
|
||||
memcpy (table, orig_table, count * sizeof (asymbol *));
|
||||
if (count != 0)
|
||||
memcpy (table, orig_table, count * sizeof (asymbol *));
|
||||
|
||||
/* Move :Main (if there is one) to the first position. This is
|
||||
necessary to get the same layout of the trie-tree when linking as
|
||||
|
Reference in New Issue
Block a user