From 3337c1e561574b6f203e17c038cb0334666cf27a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 12 Nov 2008 22:04:04 +0000 Subject: PR 7023 * elf.c (bfd_section_from_shdr ): Fail on invalid sh_info. --- bfd/elf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bfd/elf.c') diff --git a/bfd/elf.c b/bfd/elf.c index 054fd2a..cb7d2fc 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1608,6 +1608,8 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) if (hdr->sh_entsize != bed->s->sizeof_sym) return FALSE; + if (hdr->sh_info * hdr->sh_entsize > hdr->sh_size) + return FALSE; BFD_ASSERT (elf_onesymtab (abfd) == 0); elf_onesymtab (abfd) = shindex; elf_tdata (abfd)->symtab_hdr = *hdr; -- cgit v1.1