From: Paul Floyd Date: Sun, 12 Mar 2023 10:12:29 +0000 (+0100) Subject: coverity: a couple of potential buffer overruns X-Git-Tag: VALGRIND_3_21_0~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50f65336127b5f63c8af55544ce3e6a9bc834355;p=thirdparty%2Fvalgrind.git coverity: a couple of potential buffer overruns --- diff --git a/coregrind/launcher-freebsd.c b/coregrind/launcher-freebsd.c index 792a4bd239..030b183b57 100644 --- a/coregrind/launcher-freebsd.c +++ b/coregrind/launcher-freebsd.c @@ -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;