Fix assertion failure in linker triggered by corrupt input file.

PR ld/20925
	* aoutx.h (aout_link_add_symbols): Replace BFD_ASSERT with return
	FALSE.
This commit is contained in:
Nick Clifton 2016-12-05 12:14:22 +00:00
parent e9a1e93eca
commit 39d4daf68e
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-12-05 Nick Clifton <nickc@redhat.com>
PR ld/20925
* aoutx.h (aout_link_add_symbols): Replace BFD_ASSERT with return
FALSE.
2016-12-03 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (struct ppc_link_hash_entry): Delete "was_undefined".

View File

@ -3089,7 +3089,9 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
case N_INDR | N_EXT:
/* An indirect symbol. The next symbol is the symbol
which this one really is. */
BFD_ASSERT (p + 1 < pend);
/* See PR 20925 for a reproducer. */
if (p + 1 >= pend)
return FALSE;
++p;
/* PR 19629: Corrupt binaries can contain illegal string offsets. */
if (GET_WORD (abfd, p->e_strx) > obj_aout_external_string_size (abfd))