tcp_wrappers: Sprinkle some bounds-checked string copying
It isn't clear if tcpd.c is even compiled in FreeBSD. Reported by: Coverity CIDs: 1006710, 1006804 Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
a8899611ac
commit
eceeea64cb
@ -62,10 +62,10 @@ char **argv;
|
||||
*/
|
||||
|
||||
if (argv[0][0] == '/') {
|
||||
strcpy(path, argv[0]);
|
||||
strlcpy(path, argv[0], sizeof(path));
|
||||
argv[0] = strrchr(argv[0], '/') + 1;
|
||||
} else {
|
||||
sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
|
||||
snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user