mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
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. Reported by: Coverity (CWE-120) CID: 1006703 Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
bae56e46c4
commit
17fac79462
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316797
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue