Closed a1ien closed 2 years ago
I am not sure but this maybe applied also to v1. I found similar check here https://github.com/UAVCAN/libcanard/blob/master/libcanard/canard.c#L835
Looks good to me. @a1ien can you please add a test case to reproduce this error? (Let me know if you need assistance with that).
I'm still looking into the differences with the v1 code to see if we need to implement the same fix on v1 as well.
Add test. But I am not sure how correct is it.
ping @coderkalyan
Oh, sorry. Let me take a look.
Without this check we can crash here https://github.com/UAVCAN/libcanard/blob/legacy-v0/canard.c#L340-L357 This happen because when processing single frame transfer we check that
state->buffer_blocks == NULL
But if inside multi frame transfer we receive single frame transfer this assert can happen. This problem happened in real environment.