mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-08 08:33:13 +00:00
Fix seg-fault in the linker when examining a corrupt binary.
PR ld/20909 * aoutx.h (aout_link_add_symbols): Fix off-by-one error in check for an illegal string offset.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2016-12-02 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR ld/20909
|
||||||
|
* aoutx.h (aout_link_add_symbols): Fix off-by-one error in check
|
||||||
|
for an illegal string offset.
|
||||||
|
|
||||||
2016-12-02 Gary Benson <gbenson@redhat.com>
|
2016-12-02 Gary Benson <gbenson@redhat.com>
|
||||||
|
|
||||||
* elf.c (_bfd_elf_make_section_from_shdr): Pass offset to
|
* elf.c (_bfd_elf_make_section_from_shdr): Pass offset to
|
||||||
|
|||||||
@@ -3031,10 +3031,9 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* PR 19629: Corrupt binaries can contain illegal string offsets. */
|
/* PR 19629: Corrupt binaries can contain illegal string offsets. */
|
||||||
if (GET_WORD (abfd, p->e_strx) > obj_aout_external_string_size (abfd))
|
if (GET_WORD (abfd, p->e_strx) >= obj_aout_external_string_size (abfd))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
name = strings + GET_WORD (abfd, p->e_strx);
|
name = strings + GET_WORD (abfd, p->e_strx);
|
||||||
|
|
||||||
value = GET_WORD (abfd, p->e_value);
|
value = GET_WORD (abfd, p->e_value);
|
||||||
flags = BSF_GLOBAL;
|
flags = BSF_GLOBAL;
|
||||||
string = NULL;
|
string = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user