diff options
author | eadler <eadler@FreeBSD.org> | 2018-03-08 08:04:32 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2018-03-08 08:04:32 +0000 |
commit | 65d326d307a0b8b0d0ad22afddd608888d6bb5d8 (patch) | |
tree | 30cf8cf14300a4b59373ed980e2439478fb9dc97 /usr.bin | |
parent | b0dd01bc251e5f16e91ffdd8b76d17e92e21541e (diff) | |
download | FreeBSD-src-65d326d307a0b8b0d0ad22afddd608888d6bb5d8.zip FreeBSD-src-65d326d307a0b8b0d0ad22afddd608888d6bb5d8.tar.gz |
MFC r316797:
banner(6): Squash a harmless coverity warning
The destination buffer is sized as the sum of program argument lengths, so
it has plenty of room for *argv. Appease Coverity by using strlcpy instead
of strcpy. Similar to a nearby cleanup performed in r316500.
No functional change.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/banner/banner.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c index 0812aed..a968c7f 100644 --- a/usr.bin/banner/banner.c +++ b/usr.bin/banner/banner.c @@ -1062,7 +1062,7 @@ main(int argc, char *argv[]) j += strlen(argv[i]) + 1; if ((message = malloc((size_t)j)) == NULL) err(1, "malloc"); - strcpy(message, *argv); + strlcpy(message, *argv, j); while (*++argv) { strlcat(message, " ", j); strlcat(message, *argv, j); |