]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
backport 2008-11-13 Alan Modra <amodra@bigpond.net.au>
authorAlan Modra <amodra@gmail.com>
Mon, 2 Mar 2009 13:39:26 +0000 (13:39 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 2 Mar 2009 13:39:26 +0000 (13:39 +0000)
bfd/ChangeLog
bfd/elf.c

index e13de1984de47840043bd74f37bf41f8492ba798..66e1b2e44854fd8cb1ed82a226d4d0011818f8cd 100644 (file)
@@ -1,5 +1,9 @@
 2009-03-02  Alan Modra  <amodra@bigpond.net.au>
 
+       2008-11-13  Alan Modra  <amodra@bigpond.net.au>
+       PR 7023
+       * elf.c (bfd_section_from_shdr <SHT_SYMTAB>): Fail on invalid sh_info.
+
        2008-11-11  Alan Modra  <amodra@bigpond.net.au>
        PR 7012
        * dwarf2.c (find_line): Don't keep stale pointers into realloc'd
index 054fd2a410539e29e3c39017f7347f1848ab464d..cb7d2fc3e447b50da53ad3958cc6bd5d8a9968d0 100644 (file)
--- 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;