You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixesesp8266#5883 and supercedes esp8266#5890
The replace() function was using len() while in the middle of buffer
operations. In SSO mode len() is not stored separately and is a call to
strlen(), which may not be legal if you're in the middle of overwriting
the SSO buffer, as was the case in ::replace when the replacement string
was longer than the find string. This caused potential garbage at the
end of the string when accessed. Instead, just cache the length in a
local while doing the operation.
Also make setLength() explicitly write a 0 in the SSO buffer at the
specific offset. It's probably not needed, but is safe to do and makes
logical sense.
Add in test cases from esp8266#5890 as well as some new ones that fail on the
unmodified core.
0 commit comments