]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Check corrupt input
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 15 Dec 2014 16:27:57 +0000 (08:27 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 15 Dec 2014 16:32:45 +0000 (08:32 -0800)
PR ld/17713
* elflink.c (_bfd_elf_gc_mark_rsec): Check corrupt input.

bfd/ChangeLog
bfd/elflink.c

index 0ebd6d7103b792b7d41512e0f3b7ad801170cd84..a4af0beb2143d5226455581dc6bdf310493f3488 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/17713
+       * elflink.c (_bfd_elf_gc_mark_rsec): Check corrupt input.
+
 2014-12-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/17689
index c964a98021c1c77c862a2fa6450f44f9ce759d11..94ab762a53a452a9968aa9eb4f2da47ab69c954f 100644 (file)
@@ -11683,6 +11683,12 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info, asection *sec,
       || ELF_ST_BIND (cookie->locsyms[r_symndx].st_info) != STB_LOCAL)
     {
       h = cookie->sym_hashes[r_symndx - cookie->extsymoff];
+      if (h == NULL)
+       {
+         info->callbacks->einfo (_("%F%P: corrupt input: %B\n"),
+                                 sec->owner);
+         return NULL;
+       }
       while (h->root.type == bfd_link_hash_indirect
             || h->root.type == bfd_link_hash_warning)
        h = (struct elf_link_hash_entry *) h->root.u.i.link;