esp_spp_write() fails in a quite spectacular way when len is 0 (IDFGH-8523) #9977
Labels
Resolution: Done
Issue is done internally
Status: Done
Issue is done internally
Type: Feature Request
Feature request for IDF
Is your feature request related to a problem?
I had a mistake in my code which prompted the len for my buffer to be overwritten with 0 sometimes.
I realise that sending nothing (len = 0) should not be done and I could have written a check for that myself, but making esp_spp_write in a different way would be appreciated.
Currently. the message gets enqueued in osi_thread_post(), but when retrieving it, at some point in another call of fixed_queue_enqueue(), the assertion "data != NULL" gets triggered (I assume the len was used to copy the data somewhere, which failed if len=0, I did not research that in any more detail).
Describe the solution you'd like.
just returning from esp_spp_write() if len=0 would be nice.
Describe alternatives you've considered.
Writing the check myself, but since that would be needed with every esp_spp_write anyway, integrating it directly would be nicer (and you don't spend hours debugging a pretty obscure error message...).
Additional context.
No response
The text was updated successfully, but these errors were encountered: