A bogus ELF file could have sh_entsize as zero. Don't divide by zero,
but just assume there are no symbols in the section.
https://sourceware.org/bugzilla/show_bug.cgi?id=23786
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2018-10-18 Mark Wielaard <mark@klomp.org>
+
+ * arlib.c (arlib_add_symbols): Check that sh_entsize is not zero.
+
2018-10-14 Mark Wielaard <mark@klomp.org>
* ar.c (do_oper_extract): Assume epoch if ar_date is bogus.
if (data == NULL)
continue;
+ if (shdr->sh_entsize == 0)
+ continue;
+
int nsyms = shdr->sh_size / shdr->sh_entsize;
for (int ndx = shdr->sh_info; ndx < nsyms; ++ndx)
{