diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c index 5d7ed13bbb56..9eb56a172201 100644 --- a/usr.bin/split/split.c +++ b/usr.bin/split/split.c @@ -147,7 +147,8 @@ main(argc, argv) ++argv; } if (*argv != NULL) /* File name prefix. */ - (void)strcpy(fname, *argv++); + if (strlcpy(fname, *argv++, sizeof(fname)) >= sizeof(fname)) + errx(EX_USAGE, "file name prefix is too long"); if (*argv != NULL) usage();