diff options
author | Alan Modra <amodra@gmail.com> | 2010-11-04 12:44:54 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-11-04 12:44:54 +0000 |
commit | 129b5d55a3dca92ea486dfcecec18055fa6815cc (patch) | |
tree | a3ce1bb1b7c5b5eb17596c3dbe8b8120054819d5 /ld/plugin.c | |
parent | e8b36cd1e57055ea2eb1e2ba2692f1ec520b34db (diff) | |
download | gdb-129b5d55a3dca92ea486dfcecec18055fa6815cc.zip gdb-129b5d55a3dca92ea486dfcecec18055fa6815cc.tar.gz gdb-129b5d55a3dca92ea486dfcecec18055fa6815cc.tar.bz2 |
* plugin.c (is_ir_dummy_bfd): Don't segfault on NULL abfd.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r-- | ld/plugin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ld/plugin.c b/ld/plugin.c index f03932c..1e280e4 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); |