diff options
author | John Levon <john.levon@joyent.com> | 2018-12-19 18:30:10 +0000 |
---|---|---|
committer | John Levon <levon@movementarian.org> | 2019-02-16 14:43:35 +0000 |
commit | 7a34c45a19b262a37c336e71aeff5ccd8d28cf9d (patch) | |
tree | 3e849baefc692b414d5975cd58794a7986d57053 | |
parent | e37450d909c12d4fcfa77c60705f0c3756a442ac (diff) | |
download | illumos-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.c | 6 |
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); } |