-
Notifications
You must be signed in to change notification settings - Fork 423
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
Memory allocation failue check #1507
Comments
Thanks for raising this. It would be good to know which |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
libcoap Configuration Summary
Irrelevant
Problem Description
Hi!
When I was using libcoap with OSCORE, I run into a problem of unsuccessful encryption (server returned 4.01 Unauthorized). After some investigation I've found out that it was due to failed
coap_malloc_type()
and result of allocation not being checked againstNULL
. I think thatNULL
checks should be introduced after eachcoap_malloc_type()
invocation.Expected Behavior
Error log with information, that memory allocation failed, and 5.xx (probably 5.00) error code returned.
Actual Behavior
No information about failed allocation and wrong error code (4.01 suggesting an error on client's side).
Steps to reproduce
NULLchecks after allocation are missing in many places, so it requires many scenarios.
I also don't know if server returns 5.00 after memory allocation in places we check it.
Code to reproduce this issue
Debug Logs
Other items if possible
The text was updated successfully, but these errors were encountered: