summaryrefslogtreecommitdiffstats
path: root/libasm
diff options
context:
space:
mode:
Diffstat (limited to 'libasm')
-rw-r--r--libasm/ChangeLog4
-rw-r--r--libasm/disasm_cb.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index 2efd85fa..92dfd729 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-19 Mark Wielaard <[email protected]>
+
+ * disasm_cb.c (read_symtab_exec): Check sh_entsize is not zero.
+
2018-07-04 Ross Burton <[email protected]>
* asm_end.c: Remove error.h include.
diff --git a/libasm/disasm_cb.c b/libasm/disasm_cb.c
index cf278c71..80f8b25b 100644
--- a/libasm/disasm_cb.c
+++ b/libasm/disasm_cb.c
@@ -93,6 +93,8 @@ read_symtab_exec (DisasmCtx_t *ctx)
xndxdata = elf_getdata (elf_getscn (ctx->elf, xndxscnidx), NULL);
/* Iterate over all symbols. Add all defined symbols. */
+ if (shdr->sh_entsize == 0)
+ continue;
int nsyms = shdr->sh_size / shdr->sh_entsize;
for (int cnt = 1; cnt < nsyms; ++cnt)
{