summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2018-12-19 18:30:10 +0000
committerJohn Levon <levon@movementarian.org>2019-02-16 14:43:35 +0000
commit7a34c45a19b262a37c336e71aeff5ccd8d28cf9d (patch)
tree3e849baefc692b414d5975cd58794a7986d57053
parente37450d909c12d4fcfa77c60705f0c3756a442ac (diff)
downloadillumos-joyent-7a34c45a19b262a37c336e71aeff5ccd8d28cf9d.tar.gz
10128 csplit should use strlcpy
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Gergő Doma <domag02@gmail.com> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/cmd/csplit/csplit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/src/cmd/csplit/csplit.c b/usr/src/cmd/csplit/csplit.c
index 5506dbe139..456780b9a3 100644
--- a/usr/src/cmd/csplit/csplit.c
+++ b/usr/src/cmd/csplit/csplit.c
@@ -27,6 +27,10 @@
/* All Rights Reserved */
/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
+
+/*
* csplit - Context or line file splitter
* Compile: cc -O -s -o csplit csplit.c
*/
@@ -391,7 +395,7 @@ getfile()
}
if ((opfil = fopen(file, "w")) == NULL) {
- (void) strcpy(tfile, file);
+ (void) strlcpy(tfile, file, sizeof (tfile));
(void) sprintf(fptr, "%.*d", fiwidth, (ctr-2));
fatal("Cannot create %s\n", tfile);
}