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
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 against NULL. I think that NULL checks should be introduced after each coap_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:
Thanks for raising this. It would be good to know which coap_malloc_type() failed for you (file and line no). In the OSCORE specific code, NULL returns are checked for (otherwise you will be seeing memory access errors), but they may be taking wrong decisions.
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: