From 956896c50bbac8721c63ae1855f062afb64e4108 Mon Sep 17 00:00:00 2001 From: bilaliscarioth <98892516+bilaliscarioth@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:58:34 +0100 Subject: [PATCH] Replace strpcy by strlcpy Many edge case can be caused by strcpy, cause length not is taked care. --- cores/arduino/WString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index 043fda7c0..1922f2e9b 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -266,7 +266,7 @@ unsigned char String::concat(const char *cstr, unsigned int length) if (!cstr) return 0; if (length == 0) return 1; if (!reserve(newlen)) return 0; - strcpy(buffer + len, cstr); + strlcpy(buffer + len, cstr, length); len = newlen; return 1; }