2016-02-19 Nick Clifton <nickc@redhat.com>
+ PR ld/19629
+ * aoutx.h (aout_link_add_symbols): Check for out of range string
+ table offsets.
+
PR ld/19628
* reloc.c (bfd_generic_get_relocated_section_contents): Stop
processing if we encounter a reloc without an associated symbol.
if ((type & N_STAB) != 0)
continue;
+ /* PR 19629: Corrupt binaries can contain illegal string offsets. */
+ if (GET_WORD (abfd, p->e_strx) > obj_aout_external_string_size (abfd))
+ return FALSE;
name = strings + GET_WORD (abfd, p->e_strx);
+
value = GET_WORD (abfd, p->e_value);
flags = BSF_GLOBAL;
string = NULL;
which this one really is. */
BFD_ASSERT (p + 1 < pend);
++p;
+ /* PR 19629: Corrupt binaries can contain illegal string offsets. */
+ if (GET_WORD (abfd, p->e_strx) > obj_aout_external_string_size (abfd))
+ return FALSE;
string = strings + GET_WORD (abfd, p->e_strx);
section = bfd_ind_section_ptr;
flags |= BSF_INDIRECT;
return TRUE;
++p;
string = name;
+ /* PR 19629: Corrupt binaries can contain illegal string offsets. */
+ if (GET_WORD (abfd, p->e_strx) > obj_aout_external_string_size (abfd))
+ return FALSE;
name = strings + GET_WORD (abfd, p->e_strx);
section = bfd_und_section_ptr;
flags |= BSF_WARNING;