diff options
author | Mark Wielaard <mark@klomp.org> | 2020-02-07 18:20:46 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2020-02-18 13:09:26 +0100 |
commit | f4354082ba7c9d7d7c88b69a41db34f4f8a88ab5 (patch) | |
tree | b73de15bb55615febc032abdd7884f035fbdb3b9 /src/elflint.c | |
parent | 69660c6a828eddbcf703f7bf6a70b56d69516e64 (diff) | |
download | elfutils-f4354082ba7c9d7d7c88b69a41db34f4f8a88ab5.tar.gz |
elflint: Check sh_info for symtab isn't too big.
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>
Diffstat (limited to 'src/elflint.c')
-rw-r--r-- | src/elflint.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/elflint.c b/src/elflint.c index 684b794e..78d485e3 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -658,6 +658,10 @@ section [%2d] '%s': symbol table cannot have more than one extended index sectio 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; |