Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/bfd NUL-terminate warning strings correctly.



details:   https://anonhg.NetBSD.org/src/rev/b36aa2691213
branches:  trunk
changeset: 487641:b36aa2691213
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Sat Jun 10 15:22:51 2000 +0000

description:
NUL-terminate warning strings correctly.

diffstat:

 gnu/dist/bfd/elflink.h |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r e6e1325bf15b -r b36aa2691213 gnu/dist/bfd/elflink.h
--- a/gnu/dist/bfd/elflink.h    Sat Jun 10 14:59:38 2000 +0000
+++ b/gnu/dist/bfd/elflink.h    Sat Jun 10 15:22:51 2000 +0000
@@ -719,12 +719,13 @@
                }
 
              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,



Home | Main Index | Thread Index | Old Index