From: Nick Clifton Date: Tue, 31 Jan 2017 12:07:04 +0000 (+0000) Subject: Fix buffer overflows in ld when printing translated strings. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1273da0414a2f2a31288749a17fe44cbef615ab5;p=binutils-gdb.git Fix buffer overflows in ld when printing translated strings. ld * ldmain.c (add_archive_element): Eliminate string buffer. * ldlang.c (lang_print_asneeded): Likewise. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 5c5504c69f1..7ae428abdd7 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2017-01-31 Nick Clifton + + * ldmain.c (add_archive_element): Eliminate string buffer. + * ldlang.c (lang_print_asneeded): Likewise. + 2017-01-30 Maciej W. Rozycki * emultempl/mipself.em (ignore_branch_isa): New variable. diff --git a/ld/ldlang.c b/ld/ldlang.c index dafc3489fd8..1396c5b3d1d 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -2035,14 +2035,11 @@ static void lang_print_asneeded (void) { struct asneeded_minfo *m; - char buf[100]; if (asneeded_list_head == NULL) return; - sprintf (buf, _("\nAs-needed library included " - "to satisfy reference by file (symbol)\n\n")); - minfo ("%s", buf); + minfo (_("\nAs-needed library included to satisfy reference by file (symbol)\n\n")); for (m = asneeded_list_head; m != NULL; m = m->next) { diff --git a/ld/ldmain.c b/ld/ldmain.c index 1e48b1a2dbb..e049de36d75 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -871,11 +871,7 @@ add_archive_element (struct bfd_link_info *info, if (!header_printed) { - char buf[100]; - - sprintf (buf, _("Archive member included " - "to satisfy reference by file (symbol)\n\n")); - minfo ("%s", buf); + minfo (_("Archive member included to satisfy reference by file (symbol)\n\n")); header_printed = TRUE; }