Fix possible buffer overflow

This commit is contained in:
Theo Arends
2026-06-22 15:24:06 +02:00
parent 5ba66d80c3
commit ee435ea968
+1 -1
View File
@@ -264,7 +264,7 @@ boolean FtpServer::processCommand () {
else if (!strcmp (command, "CWD")) {
char path[FTP_CWD_SIZE];
if (haveParameter () && makeExistsPath (path)) {
strcpy (cwdName, path);
strlcpy (cwdName, path, sizeof(cwdName));
client.println (F("250 Ok. Current directory is ") + String (cwdName));
}
}