]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
coverity: a couple of potential buffer overruns
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 12 Mar 2023 10:12:29 +0000 (11:12 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 12 Mar 2023 10:12:29 +0000 (11:12 +0100)
coregrind/launcher-freebsd.c

index 792a4bd2398bc47fafbb6c953f6fb0791160fbc6..030b183b572fc1027cf92fca1e91df61c44ac7dc 100644 (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;