aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-11-05 01:08:18 +0000
committerAlan Modra <amodra@gmail.com>2002-11-05 01:08:18 +0000
commit89117aabb3d2bd323fa0fadef09d6d2675673387 (patch)
tree6742437a3c873be8a548faa29f74e3d8505d4719
parent226acd2e46a1ce255736468bc91ae054b6c56dcd (diff)
downloadgdb-89117aabb3d2bd323fa0fadef09d6d2675673387.zip
gdb-89117aabb3d2bd323fa0fadef09d6d2675673387.tar.gz
gdb-89117aabb3d2bd323fa0fadef09d6d2675673387.tar.bz2
* vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
non-NULL before dereferencing.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/vms-gsd.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 76158ea..c210197 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-05 Elias Athanasopoulos <eathan@otenet.gr>
+
+ * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
+ non-NULL before dereferencing.
+
2002-11-04 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* vms.c (vms_object_p): Restore the start address when returning
diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c
index 0024122..10fbb2d 100644
--- a/bfd/vms-gsd.c
+++ b/bfd/vms-gsd.c
@@ -420,7 +420,7 @@ _bfd_vms_slurp_gsd (abfd, objtype)
{
bfd_set_error (bfd_error_no_memory);
return -1;
- }
+ }
}
}
else
@@ -661,13 +661,13 @@ _bfd_vms_slurp_gsd (abfd, objtype)
}
else /* symbol reference */
{
- symbol->name =
+ symbol->name =
_bfd_vms_save_counted_string (vms_rec+8);
#if VMS_DEBUG
vms_debug(4, "egsd sym ref #%d (%s, %04x=%s)\n", abfd->symcount,
symbol->name, old_flags, flag2str(gsyflagdesc, old_flags));
#endif
- symbol->section = bfd_make_section (abfd, BFD_UND_SECTION_NAME);
+ symbol->section = bfd_make_section (abfd, BFD_UND_SECTION_NAME);
}
symbol->flags = new_flags;
@@ -901,7 +901,7 @@ _bfd_vms_write_gsd (abfd, objtype)
unsigned long ca_psindx = 0;
unsigned long psindx;
- if (old_flags & BSF_FUNCTION)
+ if ((old_flags & BSF_FUNCTION) && symbol->udata.p != NULL)
{
code_address = ((asymbol *) (symbol->udata.p))->value;
ca_psindx = ((asymbol *) (symbol->udata.p))->section->index;