diff options
author | Nick Clifton <nickc@redhat.com> | 2016-12-05 12:14:22 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2016-12-05 12:14:22 +0000 |
commit | 39d4daf68e696bbf2db417abe677b2e68f3aace9 (patch) | |
tree | b26211314d95c2ef86116a70b82918767cdb1a8f /bfd/aoutx.h | |
parent | e9a1e93ecab4e67aacb9cd6a5a953c8c0bc23027 (diff) | |
download | gdb-39d4daf68e696bbf2db417abe677b2e68f3aace9.zip gdb-39d4daf68e696bbf2db417abe677b2e68f3aace9.tar.gz gdb-39d4daf68e696bbf2db417abe677b2e68f3aace9.tar.bz2 |
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.
Diffstat (limited to 'bfd/aoutx.h')
-rw-r--r-- | bfd/aoutx.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/aoutx.h b/bfd/aoutx.h index b9ac2b7..fb7041a 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -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)) |