From 277a41452049bb3a5df7977f0a9334d579a42756 Mon Sep 17 00:00:00 2001 From: pfg Date: Wed, 6 Jan 2016 16:32:39 +0000 Subject: [PATCH] MFC r292877: pax: prevent possible buffer overflow Or at least quiet down some static analyzers about it. CID: 978835 Obtained from: OpenBSD git-svn-id: svn://svn.freebsd.org/base/stable/10@293238 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- bin/pax/pat_rep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c index e8d17db36..516519e20 100644 --- a/bin/pax/pat_rep.c +++ b/bin/pax/pat_rep.c @@ -878,7 +878,7 @@ rep_name(char *name, int *nlen, int prnt) * (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; -- 2.42.0