1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-16 00:43:00 +03:00

Avoid copying past end of buffer in String.concat (#8198)

This commit is contained in:
Paulo Cabral Sanz
2021-07-08 20:35:09 -03:00
committed by GitHub
parent a105bdd359
commit 2946ce055c
2 changed files with 11 additions and 1 deletions

View File

@ -305,7 +305,7 @@ bool String::concat(const char *cstr, unsigned int length) {
return true;
if (!reserve(newlen))
return false;
memmove_P(wbuffer() + len(), cstr, length + 1);
memmove_P(wbuffer() + len(), cstr, length);
setLen(newlen);
wbuffer()[newlen] = 0;
return true;