shift too big.
(check_verdef): Use Elf64_Word for shdr->sh_info cnt.
(check_verneed): Likewise.
+ (check_attributes): Break when vendor name isn't terminated.
+ Add overflow check for subsection_len.
2015-05-05 Mark Wielaard <mjw@redhat.com>
ERROR (gettext ("\
section [%2d] '%s': offset %zu: unterminated vendor name string\n"),
idx, section_name (ebl, idx), pos (p));
- continue;
+ break;
}
++q;
if (MY_ELFDATA != ehdr->e_ident[EI_DATA])
CONVERT (subsection_len);
- if (p - chunk < (ptrdiff_t) subsection_len)
+ /* Don't overflow, ptrdiff_t might be 32bits, but signed. */
+ if (p - chunk < (ptrdiff_t) subsection_len
+ || subsection_len >= (uint32_t) PTRDIFF_MAX)
{
ERROR (gettext ("\
section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"),