summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>2000-06-10 15:22:51 +0000
committermycroft <mycroft@NetBSD.org>2000-06-10 15:22:51 +0000
commit27ceeaf3a67c236202ca5899641e508c463f2b78 (patch)
treea1fe020aff91432c4193c612e2b1571c89cf05e3 /gnu
parentb826825917968e41324c4556747f1e199a73707f (diff)
NUL-terminate warning strings correctly.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/dist/bfd/elflink.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gnu/dist/bfd/elflink.h b/gnu/dist/bfd/elflink.h
index fa4f8a670ab..9f72859c959 100644
--- a/gnu/dist/bfd/elflink.h
+++ b/gnu/dist/bfd/elflink.h
@@ -719,12 +719,13 @@ 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,