coverity: a couple of potential buffer overruns

This commit is contained in:
Paul Floyd 2023-03-12 11:12:29 +01:00
parent d3a49926ad
commit 50f6533612

View File

@ -83,7 +83,7 @@ static const char *find_client(const char *clientname)
while (path) {
if ((colon = strchr(path, ':')) == NULL) {
strcpy(fullname, path);
strlcpy(fullname, path, PATH_MAX);
path = NULL;
} else {
memcpy(fullname, path, colon - path);
@ -91,8 +91,8 @@ static const char *find_client(const char *clientname)
path = colon + 1;
}
strcat(fullname, "/");
strcat(fullname, clientname);
strlcat(fullname, "/", PATH_MAX);
strlcat(fullname, clientname, PATH_MAX);
if (access(fullname, R_OK|X_OK) == 0) {
return fullname;