Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StreamString SSO fix #2736

Merged
merged 1 commit into from
May 11, 2019
Merged

Conversation

earlephilhower
Copy link
Contributor

Sorry, @me-no-dev, I thought we'd hammered out the issues in the SSO conversion, but there's one more but just found.

As found by @mongozmaki in esp8266/Arduino#6035

With SSO implementation in String, StreamString::write generates wrong
strings under some circumstances. Reason is that String::len() returns
strlen(sso_buf) if SSO=true but with newly written data
(in StreamString::write) the null-termination missing at the time len()
is called.

Furthermore, len() is called twice which is inefficient if SSO=true.

As found by @mongozmaki in esp8266/Arduino#6035

With SSO implementation in String, StreamString::write generates wrong
strings under some circumstances.  Reason is that String::len() returns
strlen(sso_buf) if SSO=true but with newly written data
(in StreamString::write) the null-termination missing at the time len()
is called.

Furthermore, len() is called twice which is inefficient if SSO=true.
@me-no-dev me-no-dev merged commit bd57ff4 into espressif:master May 11, 2019
@earlephilhower earlephilhower deleted the streamstringfix branch May 12, 2019 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants