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:
Conrad Meyer 2017-04-14 00:45:09 +00:00
parent 6c546e77b6
commit 4f14ba6ca3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316803

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