Catch NULL bfd pointers passed to bfd_archive_filename
authorNick Clifton <nickc@redhat.com>
Thu, 15 Apr 2004 08:48:56 +0000 (08:48 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 15 Apr 2004 08:48:56 +0000 (08:48 +0000)
bfd/ChangeLog
bfd/bfd.c

index 4c4a5417c46ebd447317fc8ed103818048038707..5bd1d7452153444bec165dff879f548d6e88edd7 100644 (file)
@@ -1,3 +1,7 @@
+2004-04-15  Nick Clifton  <nickc@redhat.com>
+
+       * bfd.c (bfd_archive_filename): Catch NULL bfd pointers.
+
 2004-04-15  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-sparc.c (sparc64_elf_check_relocs): Fix thinko last change.
index d37a48bc23bd2de04a1c3d84a9aeda3ed15ebbaf..59e22aaed8dd3aa1c0fd6ec2228118bdea411b64 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -512,6 +512,9 @@ DESCRIPTION
 const char *
 bfd_archive_filename (bfd *abfd)
 {
+  if (abfd == NULL)
+    return _("<unknown>");
+  
   if (abfd->my_archive)
     {
       static size_t curr = 0;