mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-17 13:10:12 +08:00
PR25629, objcopy : SIGSEGV in filter_symbols
PR 25629 * objcopy.c (filter_symbols): Don't segfault on NULL prefix_symbols_string.
This commit is contained in:
parent
dee35d026c
commit
d1faf7ca0a
@ -1,3 +1,9 @@
|
||||
2020-03-05 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 25629
|
||||
* objcopy.c (filter_symbols): Don't segfault on NULL
|
||||
prefix_symbols_string.
|
||||
|
||||
2020-03-04 Christian Eggers <ceggers@gmx.de>
|
||||
|
||||
* objcopy.c (copy_object): Convert from bytes to octets for
|
||||
|
@ -1580,9 +1580,14 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms,
|
||||
if (add_leading_char || prefix_symbols_string)
|
||||
{
|
||||
char *n, *ptr;
|
||||
size_t len = strlen (name) + 1;
|
||||
|
||||
ptr = n = (char *) xmalloc (1 + strlen (prefix_symbols_string)
|
||||
+ strlen (name) + 1);
|
||||
if (add_leading_char)
|
||||
len++;
|
||||
if (prefix_symbols_string)
|
||||
len += strlen (prefix_symbols_string);
|
||||
|
||||
ptr = n = (char *) xmalloc (len);
|
||||
if (add_leading_char)
|
||||
*ptr++ = bfd_get_symbol_leading_char (obfd);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user