From 6d29f50d61de03f73a2a9336378b1c846ae65924 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Sun, 4 Jun 2017 16:42:48 +0200 Subject: [PATCH] GSM A DTAP: fix detection of missing first mandatory element Bug: 13760 Change-Id: I1c062420f96104a46e5d1478eb054f086f942b54 Reviewed-on: https://code.wireshark.org/review/21946 Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin --- epan/dissectors/packet-gsm_a_dtap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index 4006bbe915..f65e3a883d 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -6974,14 +6974,15 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) if (msg_str == NULL) return len; - if (offset >= len) return len; - /* * decode elements */ if (dtap_msg_fcn == NULL) { - proto_tree_add_item(dtap_tree, hf_gsm_a_dtap_message_elements, tvb, offset, len - offset, ENC_NA); + if (offset < len) + { + proto_tree_add_item(dtap_tree, hf_gsm_a_dtap_message_elements, tvb, offset, len - offset, ENC_NA); + } } else {