-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
String::changeBuffer memory leak and crash #3555
Comments
Other places where buffer is not checked for NULL are |
This issue is partially duplicate of #3516, but perhaps buffer checking in the aforementioned functions is worth adding. |
@me21 the bugs you mention have been fixed since then:
Can you check if now all is OK on your side / ESPAsync libs ? |
Looks like. I will let know if something happens. |
Thanks! |
According to realloc() description, if reallocation fails, old buffer is not freed and null pointer is returned.
Now see String::changeBuffer() implementation:
If newbuffer is null, then old buffer pointer is overwritten and lost, leading to memory leak.
Moreover, if String::indexOf is called later, it will try to dereference null buffer pointer.
The text was updated successfully, but these errors were encountered: