* bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
authorThiemo Seufer <ths@networkno.de>
Sat, 17 May 2003 00:41:45 +0000 (00:41 +0000)
committerThiemo Seufer <ths@networkno.de>
Sat, 17 May 2003 00:41:45 +0000 (00:41 +0000)
pointers.
(_bfd_set_gp_value): Likewise.

bfd/ChangeLog
bfd/bfd.c

index bf7b1f6d047e759007d10b4f63f464f8e45b3d57..cafc614640f8737a7288aef95ac4572cddc707bc 100644 (file)
@@ -1,3 +1,9 @@
+2003-05-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+       * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
+       pointers.
+       (_bfd_set_gp_value): Likewise.
+
 2003-05-16  Michael Snyder  <msnyder@redhat.com>
        From Bernd Schmidt  <bernds@redhat.com>
        * archures.c (bfd_mach_h8300sx): New.
index 32250823a19a61f9ffab4dd3713526a010f52593..99c5ea668e818ce530db6db6c55aaf513c7d9a5a 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -894,6 +894,8 @@ bfd_vma
 _bfd_get_gp_value (abfd)
      bfd *abfd;
 {
+  if (! abfd)
+    return 0;
   if (abfd->format != bfd_object)
     return 0;
 
@@ -912,6 +914,8 @@ _bfd_set_gp_value (abfd, v)
      bfd *abfd;
      bfd_vma v;
 {
+  if (! abfd)
+    BFD_FAIL ();
   if (abfd->format != bfd_object)
     return;