summaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2010-11-04 12:44:53 +0000
committerAlan Modra <amodra@bigpond.net.au>2010-11-04 12:44:53 +0000
commit62a6d85d00d219c7ad5be1e40f8772e85722409e (patch)
treeb8e8da101e2fd42c59aa5c8d236b6526c91acbd6 /ld/plugin.c
parentce565eb051da9db291bf42b26ee328e695b62800 (diff)
downloadbinutils-redhat-62a6d85d00d219c7ad5be1e40f8772e85722409e.tar.gz
* plugin.c (is_ir_dummy_bfd): Don't segfault on NULL abfd.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index f03932c096..1e280e4cd2 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);