public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: utils: cygcheck: avoid GCC warning concatenating strings
Date: Fri,  7 Aug 2020 13:16:24 +0000 (GMT)	[thread overview]
Message-ID: <20200807131624.4C037384241E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9beb7b977162bd576da325ce8e23152e70989f78

commit 9beb7b977162bd576da325ce8e23152e70989f78
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Aug 7 13:30:40 2020 +0200

    Cygwin: utils: cygcheck: avoid GCC warning concatenating strings
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/utils/dump_setup.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc
index 4415954f9..ec70da0db 100644
--- a/winsup/utils/dump_setup.cc
+++ b/winsup/utils/dump_setup.cc
@@ -77,11 +77,15 @@ parse_filename (const char *in_fn, fileparse& f)
     else if (strcasecmp (ver, "-src") == 0 ||
 	     strcasecmp (ver, "-patch") == 0)
       {
+	size_t len;
+
 	*ver++ = '\0';
 	strcpy (f.pkg, p);
 	strcpy (f.what, strlwr (ver));
 	strcpy (f.pkgtar, p);
-	strcat (f.pkgtar, f.tail);
+	len = strlen (f.pkgtar);
+	strncpy (f.pkgtar + len, f.tail, sizeof (f.pkgtar) - len);
+	f.pkgtar[MAX_PATH] = '\0';
 	ver = strchr (ver, '\0');
 	break;
       }


                 reply	other threads:[~2020-08-07 13:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200807131624.4C037384241E@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).