Skip to content

Commit

Permalink
Replace strpcy by strlcpy
Browse files Browse the repository at this point in the history
Many edge case can be caused by strcpy, cause length not is taked care.
  • Loading branch information
bilaliscarioth authored Jan 16, 2025
1 parent c8c514c commit 956896c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cores/arduino/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 956896c

Please sign in to comment.