From 546d8763e9375473ed479d048e9ab0ed8562bda6 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Thu, 1 Feb 2024 18:33:50 -0500 Subject: [PATCH] GTPv2: Handle EPS Security Context long EAR data Similar to the UMTS MM Context, when the Extended Access Restriction Data length is greater than 1, handle the length but indicate that we don't dissect it yet. Also fix two of the UMTS MM Context expert infos being added to the wrong tree. Fix #19630 --- epan/dissectors/packet-gtpv2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index 40767a3ee7..d0d67687cf 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -4722,7 +4722,7 @@ dissect_gtpv2_mm_context_utms_q(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre proto_tree_add_bitmask_list(tree, tvb, offset, 1, ear_flags, ENC_BIG_ENDIAN); offset += 1; if (ear_len > 1) { - proto_tree_add_expert_format(flag_tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet"); + proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet"); offset += ear_len - 1; } } else { @@ -4733,7 +4733,7 @@ dissect_gtpv2_mm_context_utms_q(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre return; } /* ts+1) to (n+4) These octet(s) is/are present only if explicitly specified */ - proto_tree_add_expert_format(flag_tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet"); + proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet"); } @@ -4942,6 +4942,10 @@ dissect_gtpv2_mm_context_eps_qq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre proto_tree_add_bitmask_list(tree, tvb, offset, 1, ear_flags, ENC_BIG_ENDIAN); offset += 1; + if (ex_access_res_data_len > 1) { + proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, ex_access_res_data_len - 1, "The rest of the IE not dissected yet"); + offset += ex_access_res_data_len - 1; + } } if (offset == (gint)length) {