From: Philippe Proulx Date: Sun, 7 Apr 2019 02:16:36 +0000 (-0400) Subject: Fix: msg-iter.c: accept no packet total and content sizes X-Git-Tag: v2.0.0-pre5~111 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=cf19c159bd9f67321e73367982cd5aa977457cbb Fix: msg-iter.c: accept no packet total and content sizes This changes an assertion in set_current_packet_content_sizes() to check that either both the packet and content sizes are set (one can be set from the other) or both are unset. It's okay that both total and content sizes are unset: the data decoder is already implemented to end the packet when the medium returns `BT_MSG_ITER_MEDIUM_STATUS_EOF`. Signed-off-by: Philippe Proulx --- diff --git a/plugins/ctf/common/msg-iter/msg-iter.c b/plugins/ctf/common/msg-iter/msg-iter.c index b7a0b9fd..0d41638e 100644 --- a/plugins/ctf/common/msg-iter/msg-iter.c +++ b/plugins/ctf/common/msg-iter/msg-iter.c @@ -979,8 +979,10 @@ enum bt_msg_iter_status set_current_packet_content_sizes( } } - BT_ASSERT(notit->cur_exp_packet_total_size != -1); - BT_ASSERT(notit->cur_exp_packet_content_size != -1); + BT_ASSERT((notit->cur_exp_packet_total_size >= 0 && + notit->cur_exp_packet_content_size >= 0) || + (notit->cur_exp_packet_total_size < 0 && + notit->cur_exp_packet_content_size < 0)); if (notit->cur_exp_packet_content_size > notit->cur_exp_packet_total_size) {