From 1089bd47f8b3ba3756fe7b220394d53e920ac059 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Mon, 23 Aug 2021 11:50:03 -0500 Subject: RTPS: fixed expected size of fragment number set The size of this submessage is 8 + the number of 32-bit ints needed for the value of the num_bits field to be represented in the bitmap. --- epan/dissectors/packet-rtps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'epan') diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c index c0ae71811f..212fe79fa7 100644 --- a/epan/dissectors/packet-rtps.c +++ b/epan/dissectors/packet-rtps.c @@ -5646,7 +5646,7 @@ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinf * message match what is here. If not re-decode it as 64-bit. */ num_bits = tvb_get_guint32(tvb, offset+4, encoding); - expected_size = (((num_bits / 8) + 3) / 4) * 4 + 8; + expected_size = ((num_bits + 31) / 32) * 4 + 8; if (expected_size == section_size) { base = (guint64)tvb_get_guint32(tvb, offset, encoding); base_size = 4; -- cgit v1.2.3