The sh_info field of the symtab says how many symbols are in the
section. Make sure at least that many symbols fit in the section.
Reported-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2020-02-07 Mark Wielaard <mark@klomp.org>
+
+ * elflint.c (check_symtab): Check st_info isn't too big.
+
2020-01-16 Mark Wielaard <mark@klomp.org>
* nm.c (show_symbols_sysv): Iterate over all symbols starting
ERROR (gettext ("\
section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
idx, section_name (ebl, idx));
+ else if (shdr->sh_info > shdr->sh_size / sh_entsize)
+ ERROR (gettext ("\
+section [%2u] '%s': number of local entries in 'st_info' larger than table size\n"),
+ idx, section_name (ebl, idx));
/* Test the zeroth entry. */
GElf_Sym sym_mem;