From cf19c159bd9f67321e73367982cd5aa977457cbb Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Sat, 6 Apr 2019 22:16:36 -0400 Subject: [PATCH] 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 --- plugins/ctf/common/msg-iter/msg-iter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) { -- 2.34.1