summaryrefslogtreecommitdiffstats
path: root/src/nm.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2015-05-08 17:56:32 +0200
committerMark Wielaard <[email protected]>2015-05-13 16:31:52 +0200
commita2b964c7dbbf54162b2c50931c172568fb4cfa70 (patch)
treee8c3061ff4e211b41701acd574360b729f3f6f9d /src/nm.c
parentf0855403012fe34aee248353e4435d0b5c6576ef (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nm.c b/src/nm.c
index 7d20bbbd..8d197158 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -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),