Module Name: src
Committed By: christos
Date: Wed Jun 13 15:14:41 UTC 2018
Modified Files:
src/bin/pax: pat_rep.c
Log Message:
PR/53362: Thomas Barabosch: Use strlcpy() to prevent theoretical buffer
overflow.
To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/bin/pax/pat_rep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/pax/pat_rep.c
diff -u src/bin/pax/pat_rep.c:1.29 src/bin/pax/pat_rep.c:1.30
--- src/bin/pax/pat_rep.c:1.29 Tue Apr 7 15:52:35 2009
+++ src/bin/pax/pat_rep.c Wed Jun 13 11:14:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pat_rep.c,v 1.29 2009/04/07 19:52:35 perry Exp $ */
+/* $NetBSD: pat_rep.c,v 1.30 2018/06/13 15:14:40 christos Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
#else
-__RCSID("$NetBSD: pat_rep.c,v 1.29 2009/04/07 19:52:35 perry Exp $");
+__RCSID("$NetBSD: pat_rep.c,v 1.30 2018/06/13 15:14:40 christos Exp $");
#endif
#endif /* not lint */
@@ -924,7 +924,7 @@ rep_name(char *name, size_t namelen, int
* (the user already saw that substitution go by)
*/
pt = rephead;
- (void)strcpy(buf1, name);
+ (void)strlcpy(buf1, name, sizeof(buf1));
inpt = buf1;
outpt = nname;
endpt = outpt + PAXPATHLEN;