Closed pavel-kirienko closed 2 years ago
Here:
https://github.com/UAVCAN/nunavut/blob/a90eac2749c1466bdff71a5bf19085e0c2de2299/src/nunavut/lang/c/templates/deserialization.j2#L14
If *inout_buffer_size_bytes == 0, buffer may be NULL because there is no data to deserialize, which is not an error.
*inout_buffer_size_bytes == 0
buffer
The check should be updated like:
-- (buffer == {{ valuetoken_null }}) ++ ((buffer == {{ valuetoken_null }}) && (0 != *inout_buffer_size_bytes))
This is a problem because libcanard intentionally emits null payload pointers for zero-sized payloads (as documented).
Here:
https://github.com/UAVCAN/nunavut/blob/a90eac2749c1466bdff71a5bf19085e0c2de2299/src/nunavut/lang/c/templates/deserialization.j2#L14
If
*inout_buffer_size_bytes == 0
,buffer
may be NULL because there is no data to deserialize, which is not an error.The check should be updated like:
This is a problem because libcanard intentionally emits null payload pointers for zero-sized payloads (as documented).