Skip to content

Commit 782c32d

Browse files
authored
String::copy() Should not copy more than given length
1 parent 80944fe commit 782c32d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cores/esp32/WString.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ String &String::copy(const char *cstr, unsigned int length) {
230230
invalidate();
231231
return *this;
232232
}
233-
memmove(wbuffer(), cstr, length + 1);
233+
memmove(wbuffer(), cstr, length);
234234
setLen(length);
235235
return *this;
236236
}

0 commit comments

Comments
 (0)