summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-12-29 16:31:28 +0000
committerpfg <pfg@FreeBSD.org>2015-12-29 16:31:28 +0000
commite9f93eed438913bd030866f9c8660fb2678b97d6 (patch)
tree65e55edc7b69c9f4654564f847acfec23e884ecb
parent13531e867aedbfed5bedf5c463b63994d6dedfe2 (diff)
downloadFreeBSD-src-e9f93eed438913bd030866f9c8660fb2678b97d6.zip
FreeBSD-src-e9f93eed438913bd030866f9c8660fb2678b97d6.tar.gz
pax: prevent possible buffer overflow
Or at least quiet down some static analyzers about it. CID: 978835 MFC after: 1 week Obtained from: OpenBSD
-rw-r--r--bin/pax/pat_rep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index e8d17db..516519e 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;
OpenPOWER on IntegriCloud