Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 2015 07:47:37 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282452 - head/usr.bin/vgrind
Message-ID:  <201505050747.t457lbrr014340@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Tue May  5 07:47:36 2015
New Revision: 282452
URL: https://svnweb.freebsd.org/changeset/base/282452

Log:
  Use strlcpy(3) instead of strcpy(3)

Modified:
  head/usr.bin/vgrind/vgrindefs.c

Modified: head/usr.bin/vgrind/vgrindefs.c
==============================================================================
--- head/usr.bin/vgrind/vgrindefs.c	Tue May  5 07:42:40 2015	(r282451)
+++ head/usr.bin/vgrind/vgrindefs.c	Tue May  5 07:47:36 2015	(r282452)
@@ -145,7 +145,7 @@ tnchktc(void)
 	/* p now points to beginning of last field */
 	if (p[0] != 't' || p[1] != 'c')
 		return(1);
-	strcpy(tcname,p+3);
+	strlcpy(tcname, p+3, 16);
 	q = tcname;
 	while (q && *q != ':')
 		q++;
@@ -163,7 +163,7 @@ tnchktc(void)
 		write(STDERR_FILENO, "Vgrind entry too long\n", 23);
 		q[BUFSIZ - (p-tbuf)] = 0;
 	}
-	strcpy(p, q+1);
+	strlcpy(p, q+1, BUFSIZ - (p - holdtbuf));
 	tbuf = holdtbuf;
 	return(1);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505050747.t457lbrr014340>