From d2b249a445e7c1d69a558b6209a2ec9dd7634cca Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Fri, 22 Oct 2021 23:45:20 -0400 Subject: [PATCH] COSE: Fix fallback to CBOR dissection when map key is registered but disabled. --- epan/dissectors/packet-cose.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/packet-cose.c b/epan/dissectors/packet-cose.c index a433dc5a11..295c62152e 100644 --- a/epan/dissectors/packet-cose.c +++ b/epan/dissectors/packet-cose.c @@ -397,8 +397,9 @@ static void dissect_header_pair(dissector_table_t dis_table, cose_header_context gint sublen = 0; if (dissector) { - sublen = call_dissector_with_data(dissector, tvb_value, pinfo, tree_label, ctx); - if ((sublen < 0) || ((guint)sublen < tvb_captured_length(tvb_value))) { + sublen = call_dissector_only(dissector, tvb_value, pinfo, tree_label, ctx); + if ((sublen < 0) || + ((sublen > 0) && ((guint)sublen < tvb_reported_length(tvb_value)))) { expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_value_partial_decode); } } @@ -698,7 +699,7 @@ static int dissect_cose_msg_tagged(tvbuff_t *tvb, packet_info *pinfo, proto_tree continue; } g_log(LOG_DOMAIN, G_LOG_LEVEL_INFO, "main dissector using tag %" G_GUINT64_FORMAT, tag->value); - int sublen = call_dissector_with_data(dissector, tvb, pinfo, tree, tag); + int sublen = call_dissector_only(dissector, tvb, pinfo, tree, tag); if (sublen > 0) { return sublen; }