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:
cem 2017-04-14 00:45:09 +00:00
parent a8899611ac
commit eceeea64cb

View File

@ -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]);
}
/*