-
Notifications
You must be signed in to change notification settings - Fork 21
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
Overflow check missing in _sbrk_r ? #16
Comments
Sorry, I'm afraid I don't understand your question? |
Imagine |
Go it, yes could overflow depending on memory layout. |
I also don't know exactly how newlib's implementation of Anyhow, just wanted to point it out in case. Thank you for your precious thread safe explanation and implementation of Best regards |
Thanks, much appreciated! |
I've noticed that the pointer comparison I've proposed in my first comment above does not work. See https://stackoverflow.com/a/6702196/11512417 The following should be correct:
In this regards, there might also be an issue in your line |
A pull-request including arithmetic tests would be appreciated, Thanks! |
I am not sure about all the check that are being done by the newlib's
_malloc_r
implementation, but in yourheap_useNewlib_ST.c
file, isn't it safer to also add the following check in your_sbrk_r
implementation to make sure we do not overflow thecurrentHeapEnd
pointer:The text was updated successfully, but these errors were encountered: