The check added in commit
4540ea98c "strip: Fix check test for SHN_XINDEX
symbol" was not complete. The (extended) section index should also exist.
If it doesn't exist, mark the file as illformed.
https://sourceware.org/bugzilla/show_bug.cgi?id=24385
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2019-03-27 Mark Wielaard <mark@klomp.org>
+
+ * strip (handle_elf): Assert that symbol section number exists.
+
2019-01-24 Mark Wielaard <mark@klomp.org>
* strip.c (handle_elf): Fix check test for SHN_XINDEX symbol.
&& shndxdata->d_buf != NULL);
size_t sidx = (sym->st_shndx != SHN_XINDEX
? sym->st_shndx : xshndx);
+ elf_assert (sidx < shnum);
sec = shdr_info[sidx].idx;
if (sec != 0)