Check sh_entsize is not zero.
authorMark Wielaard <mark@klomp.org>
Fri, 19 Oct 2018 13:01:29 +0000 (15:01 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 19 Oct 2018 22:13:10 +0000 (00:13 +0200)
commit1e7c230b277b6eb82577a3bc4b56ca291c28964d
treec49c147eef876edee8ef5fd4592a104f2bfa286e
parent22d2d082d57a7470fadc0eae67179553f4919209
Check sh_entsize is not zero.

There were some recent bug reports where we trusted the ELF section header
to be sane and divided the sh_size by the sh_entsize to get the number of
objects in the section. This would cause a divide by zero if the file was
corrupt and the sh_entsize was zero. Add checks for any such code.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libasm/ChangeLog
libasm/disasm_cb.c
libdwfl/ChangeLog
libdwfl/dwfl_module_getdwarf.c
src/ChangeLog
src/unstrip.c