Fix an illegal memory access when parsing a corrupt ELF file.
authorNick Clifton <nickc@redhat.com>
Thu, 14 Mar 2019 16:03:07 +0000 (16:03 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 14 Mar 2019 16:03:07 +0000 (16:03 +0000)
PR 24333
* elflink.c (_bfd_elf_add_default_symbol): Add a check for a NULL
section owner pointer when adding the default symbol.

bfd/ChangeLog
bfd/elflink.c

index 447eb70..7ed3929 100644 (file)
@@ -1,5 +1,11 @@
 2019-03-14  Nick Clifton  <nickc@redhat.com>
 
+       PR 24333
+       * elflink.c (_bfd_elf_add_default_symbol): Add a check for a NULL
+       section owner pointer when adding the default symbol.
+
+2019-03-14  Nick Clifton  <nickc@redhat.com>
+
        PR 24332
        * elflink.c (elf_link_add_object_symbols): Add new local variable
        extversym_end.  Initialise it to point to the end of the version
index 3ac58da..3413726 100644 (file)
@@ -1941,6 +1941,7 @@ _bfd_elf_add_default_symbol (bfd *abfd,
        {
          bh = &hi->root;
          if (bh->type == bfd_link_hash_defined
+             && bh->u.def.section->owner != NULL
              && (bh->u.def.section->owner->flags & BFD_PLUGIN) != 0)
            {
              /* Mark the previous definition from IR object as