From: Sandra Loosemore Date: Tue, 19 Feb 2013 03:59:08 +0000 (+0000) Subject: 2013-02-19 Sandra Loosemore X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46fed7f7c29ff8718cd97703188a15d8ee897be1;p=binutils-gdb.git 2013-02-19 Sandra Loosemore PR ld/15146 ld/ * plugin.c (plugin_notice): Add null check before dereferencing pointer. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index bfd2efcb508..af8f7fde2dc 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2013-02-19 Sandra Loosemore + + PR ld/15146 + * plugin.c (plugin_notice): Add null check before dereferencing + pointer. + 2013-02-19 Alan Modra * emultempl/elf32.em (emit_note_gnu_build_id): New static var. diff --git a/ld/plugin.c b/ld/plugin.c index d880164ded9..23a4a78ee99 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -997,7 +997,8 @@ plugin_notice (struct bfd_link_info *info, /* Replace the undefined dummy bfd with the real one. */ if ((h->type == bfd_link_hash_undefined || h->type == bfd_link_hash_undefweak) - && (h->u.undef.abfd->flags & BFD_PLUGIN) != 0) + && (h->u.undef.abfd == NULL + || (h->u.undef.abfd->flags & BFD_PLUGIN) != 0)) h->u.undef.abfd = abfd; h->non_ir_ref = TRUE; }