Signed-off-by: Mark Wielaard <mjw@redhat.com>
2014-12-15 Mark Wielaard <mjw@redhat.com>
+ * elf_getarsym.c (elf_getarsym): Check index_size doesn't overflow.
+
+2014-12-15 Mark Wielaard <mjw@redhat.com>
+
* elf_begin.c (read_long_names): Clear any garbage left in the
name table.
tmpbuf[10] = '\0';
size_t index_size = atol (tmpbuf);
- if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
+ if (index_size > elf->maximum_size
+ || elf->maximum_size - index_size < SARMAG + sizeof (struct ar_hdr)
#if SIZE_MAX <= 4294967295U
|| n >= SIZE_MAX / sizeof (Elf_Arsym)
#endif