diff options
| author | Mark Wielaard <[email protected]> | 2015-05-08 17:56:32 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2015-05-13 16:31:52 +0200 |
| commit | a2b964c7dbbf54162b2c50931c172568fb4cfa70 (patch) | |
| tree | e8c3061ff4e211b41701acd574360b729f3f6f9d /src/nm.c | |
| parent | f0855403012fe34aee248353e4435d0b5c6576ef (diff) | |
Always call gelf_fsize with EV_CURRENT as argument.
Don't trust the elf version given by the file. It could be completely
bogus. In which case gelf_fsize just returns zero. Which could cause
divide by zero errors.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c34
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src/nm.c')
| -rw-r--r-- | src/nm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1166,7 +1166,7 @@ show_symbols (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, Elf_Scn *xndxscn, /* Consistency checks. */ if (entsize == 0 - || entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, ehdr->e_version)) + || entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT)) error (0, 0, gettext ("%s: entry size in section %zd `%s' is not what we expect"), fullname, elf_ndxscn (scn), |
