diff options
Diffstat (limited to 'bfd/elf32-rl78.c')
-rw-r--r-- | bfd/elf32-rl78.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c index b7e3464..f4abf04 100644 --- a/bfd/elf32-rl78.c +++ b/bfd/elf32-rl78.c @@ -2121,10 +2121,14 @@ rl78_elf_relax_section if (shndx_hdr && shndx_hdr->sh_size != 0) { - bfd_size_type amt; + size_t amt; - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); + if (_bfd_mul_overflow (symtab_hdr->sh_info, + sizeof (Elf_External_Sym_Shndx), &amt)) + { + bfd_set_error (bfd_error_no_memory); + goto error_return; + } shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); if (shndx_buf == NULL) goto error_return; |