Fix a seg-fault when stripping a corrupt binary.
authorNick Clifton <nickc@redhat.com>
Thu, 2 Jun 2016 15:20:27 +0000 (16:20 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 2 Jun 2016 15:20:27 +0000 (16:20 +0100)
PR 20089
* objcopy.c (group_signature): Fail if the input symbol table has
not been loaded.

binutils/ChangeLog
binutils/objcopy.c

index 9dfaf2b8f278c534bc1fbfb0acf5f717f0ed7ca6..a91b99b4e7e45470e2a1f8321b208865a68532f3 100644 (file)
@@ -1,5 +1,9 @@
 2016-06-02  Nick Clifton  <nickc@redhat.com>
 
+       PR 20089
+       * objcopy.c (group_signature): Fail if the input symbol table has
+       not been loaded.
+
        * dwarf.c (display_debug_frames): Do not display any
        interpretation if the block consists solely of DW__CFA_NOPs.
 
index 94267616caf0848b14fdcec4f48a3d22e32cee25..98332cd3dc2c1f748e5e17081ccdab93769a02d9 100644 (file)
@@ -1125,6 +1125,10 @@ group_signature (asection *group)
   bfd *abfd = group->owner;
   Elf_Internal_Shdr *ghdr;
 
+  /* PR 20089: An earlier error may have prevented us from loading the symbol table.  */
+  if (isympp == NULL)
+    return NULL;
+
   if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
     return NULL;