From: Thiemo Seufer Date: Sat, 17 May 2003 00:41:45 +0000 (+0000) Subject: * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9bcf4de0ded2d7a6eeddd3523756ea2bee8b8fb4;p=binutils-gdb.git * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null pointers. (_bfd_set_gp_value): Likewise. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bf7b1f6d047..cafc614640f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2003-05-17 Thiemo Seufer + + * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null + pointers. + (_bfd_set_gp_value): Likewise. + 2003-05-16 Michael Snyder From Bernd Schmidt * archures.c (bfd_mach_h8300sx): New. diff --git a/bfd/bfd.c b/bfd/bfd.c index 32250823a19..99c5ea668e8 100644 --- 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;