From 129b5d55a3dca92ea486dfcecec18055fa6815cc Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 4 Nov 2010 12:44:54 +0000 Subject: [PATCH] * plugin.c (is_ir_dummy_bfd): Don't segfault on NULL abfd. --- ld/ChangeLog | 4 ++++ ld/plugin.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index b6cada28aad..2b037e420bf 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,7 @@ +2010-11-04 Alan Modra + + * plugin.c (is_ir_dummy_bfd): Don't segfault on NULL abfd. + 2010-11-03 Nick Clifton PR ld/12001 diff --git a/ld/plugin.c b/ld/plugin.c index f03932c0967..1e280e4cd21 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -245,7 +245,11 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate) bfd_boolean is_ir_dummy_bfd (const bfd *abfd) { - size_t namlen = strlen (abfd->filename); + size_t namlen; + + if (abfd == NULL) + return FALSE; + namlen = strlen (abfd->filename); if (namlen < IRONLY_SUFFIX_LEN) return FALSE; return !strcmp (abfd->filename + namlen - IRONLY_SUFFIX_LEN, IRONLY_SUFFIX); -- 2.30.2