Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2014-12-13 Mark Wielaard <mjw@redhat.com>
+
+ * dwfl_module_getdwarf.c (find_dynsym): elf_getdata_rawchunk takes
+ a size_t, make sure it doesn't overflow.
+
2014-12-13 Mark Wielaard <mjw@redhat.com>
* cu.c (cudie_offset): Make sure Dwarf_Off difference doesn't
* sizeof (Elf32_Word)
* header->maskwords));
- data = elf_getdata_rawchunk (mod->main.elf, buckets_at,
+ // elf_getdata_rawchunk takes a size_t, make sure it
+ // doesn't overflow.
+#if SIZE_MAX <= UINT32_MAX
+ if (nbuckets > SIZE_MAX / sizeof (Elf32_Word))
+ data = NULL;
+ else
+#endif
+ data
+ = elf_getdata_rawchunk (mod->main.elf, buckets_at,
nbuckets * sizeof (Elf32_Word),
ELF_T_WORD);
if (data != NULL && symndx < nbuckets)