aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-09-20 02:45:04 +0000
committerIan Lance Taylor <ian@airs.com>1998-09-20 02:45:04 +0000
commitd7298d8f7eecd1385e73f3f622022c5550b8924d (patch)
tree411c79fa6ac082c6fcdf87e17c61a8a2cb321614 /bfd
parent864e89fc9d0ed8e5ae9acdd59647c0cbf63089fb (diff)
downloadgdb-d7298d8f7eecd1385e73f3f622022c5550b8924d.zip
gdb-d7298d8f7eecd1385e73f3f622022c5550b8924d.tar.gz
gdb-d7298d8f7eecd1385e73f3f622022c5550b8924d.tar.bz2
Sat Sep 19 22:42:23 1998 Doug Rabson <dfr@nlsystems.com>
* elflink.h (elf_link_add_object_symbols): Ensure that the warning message has a null byte terminator.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7872936..cb3a22c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+Sat Sep 19 22:42:23 1998 Doug Rabson <dfr@nlsystems.com>
+
+ * elflink.h (elf_link_add_object_symbols): Ensure that the warning
+ message has a null byte terminator.
+
Fri Sep 18 14:35:29 1998 Nick Clifton <nickc@cygnus.com>
* elf32-v850.c (v850_elf_perform_relocation): Ignore contents of
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 5b44aed..64f8de80 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -717,13 +717,15 @@ elf_link_add_object_symbols (abfd, info)
}
sz = bfd_section_size (abfd, s);
- msg = (char *) bfd_alloc (abfd, sz);
+ msg = (char *) bfd_alloc (abfd, sz + 1);
if (msg == NULL)
goto error_return;
if (! bfd_get_section_contents (abfd, s, msg, (file_ptr) 0, sz))
goto error_return;
+ msg[sz] = '\0';
+
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, name, BSF_WARNING, s, (bfd_vma) 0, msg,
false, collect, (struct bfd_link_hash_entry **) NULL)))