summaryrefslogtreecommitdiffstats
path: root/contrib/binutils
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-09-19 22:31:40 +0000
committerjdp <jdp@FreeBSD.org>1998-09-19 22:31:40 +0000
commitb773a127aeed9e7ce9292d3296446a4a19b8d11a (patch)
treefb29949ff9c1f21b9e88777d45ce26e22068151a /contrib/binutils
parent610fc53b706e00167cb0a44f97a34fbc26b9c814 (diff)
downloadFreeBSD-src-b773a127aeed9e7ce9292d3296446a4a19b8d11a.zip
FreeBSD-src-b773a127aeed9e7ce9292d3296446a4a19b8d11a.tar.gz
Fix segmentation violation that sometimes occurred when warning
symbols were used. PR: bin/7980 Submitted by: Doug Rabson <dfr>
Diffstat (limited to 'contrib/binutils')
-rw-r--r--contrib/binutils/bfd/elflink.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/binutils/bfd/elflink.h b/contrib/binutils/bfd/elflink.h
index 21bd270..4389be0 100644
--- a/contrib/binutils/bfd/elflink.h
+++ b/contrib/binutils/bfd/elflink.h
@@ -719,13 +719,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)))
OpenPOWER on IntegriCloud