summaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-12-31 00:40:02 +0100
committerMark Wielaard <[email protected]>2015-01-15 14:03:08 +0100
commitd973206f716d441634f3b937be9c8c5b8b6250db (patch)
tree363acb67f594df25cddb80326b702c088235d7b5 /backends
parent0a545e678f2c0605ba050b4f72080572ac7c8470 (diff)
backends: Check sh_entsize is not zero in ppc_symbol.c (find_dyn_got).
Found with afl-fuzz. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'backends')
-rw-r--r--backends/ChangeLog4
-rw-r--r--backends/ppc_symbol.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog
index e800d16b..57e1b8ee 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-30 Mark Wielaard <[email protected]>
+
+ * ppc_symbol.c (find_dyn_got): Check sh_entsize is not zero.
+
2014-12-18 Ulrich Drepper <[email protected]>
* Makefile.am: Suppress output of textrel_check command.
diff --git a/backends/ppc_symbol.c b/backends/ppc_symbol.c
index c17ab374..733114b6 100644
--- a/backends/ppc_symbol.c
+++ b/backends/ppc_symbol.c
@@ -98,7 +98,8 @@ find_dyn_got (Elf *elf, GElf_Addr *addr)
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
Elf_Data *data = elf_getdata (scn, NULL);
- if (shdr != NULL && shdr->sh_type == SHT_DYNAMIC && data != NULL)
+ if (shdr != NULL && shdr->sh_type == SHT_DYNAMIC && data != NULL
+ && shdr->sh_entsize != 0)
for (unsigned int j = 0; j < shdr->sh_size / shdr->sh_entsize; ++j)
{
GElf_Dyn dyn_mem;