Before checking symbol index zero we should make sure the data size
is big enough.
https://sourceware.org/bugzilla/show_bug.cgi?id=21310
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2017-03-27 Mark Wielaard <mark@klomp.org>
+
+ * elflint.c (check_symtab_shndx): Check data->d_size.
+
2017-03-24 Mark Wielaard <mjw@redhat.com>
* elfcmp.c (main): If n_namesz == 0 then the note name data is the
return;
}
- if (*((Elf32_Word *) data->d_buf) != 0)
+ if (data->d_size < sizeof (Elf32_Word)
+ || *((Elf32_Word *) data->d_buf) != 0)
ERROR (gettext ("symbol 0 should have zero extended section index\n"));
for (size_t cnt = 1; cnt < data->d_size / sizeof (Elf32_Word); ++cnt)