From e4257999ea731017262b1469fac54db42dcc2877 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 22 Apr 2023 18:21:02 +0300 Subject: [PATCH] Extend the correct_start guard --- libcanard/canard.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcanard/canard.c b/libcanard/canard.c index a99996b..9b2353b 100644 --- a/libcanard/canard.c +++ b/libcanard/canard.c @@ -867,7 +867,9 @@ CANARD_PRIVATE int8_t rxSessionUpdate(CanardInstance* const ins, const bool correct_transport = (rxs->redundant_transport_index == redundant_transport_index); const bool correct_toggle = (frame->toggle == rxs->toggle); const bool correct_tid = (frame->transfer_id == rxs->transfer_id); - const bool correct_start = frame->start_of_transfer || (rxs->total_payload_size > 0); + const bool correct_start = frame->start_of_transfer // + ? (0 == rxs->total_payload_size) + : (rxs->total_payload_size > 0); if (correct_transport && correct_toggle && correct_tid && correct_start) { out = rxSessionAcceptFrame(ins, rxs, frame, extent, out_transfer);