From 98bdb27ebb8a03d22ca4ba2511aade7b0c09f270 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Fri, 30 Aug 2019 09:11:55 +0200 Subject: NAS 5GS: fix dissection of 5GSM capability IE This IE has a variable length to allow future extension. Change-Id: I158ef8a8aa2f5cace992113a9efeb324beebe1aa Reviewed-on: https://code.wireshark.org/review/34402 Reviewed-by: Pascal Quantin --- epan/dissectors/packet-nas_5gs.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/epan/dissectors/packet-nas_5gs.c b/epan/dissectors/packet-nas_5gs.c index 619ecf523f..75d34fab6b 100644 --- a/epan/dissectors/packet-nas_5gs.c +++ b/epan/dissectors/packet-nas_5gs.c @@ -2371,10 +2371,11 @@ de_nas_5gs_mm_ul_data_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo */ static guint16 -de_nas_5gs_sm_5gsm_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, - guint32 offset, guint len _U_, +de_nas_5gs_sm_5gsm_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, + guint32 offset, guint len, gchar *add_string _U_, int string_len _U_) { + guint32 curr_offset = offset; static const int * flags[] = { &hf_nas_5gs_spare_b7, @@ -2388,10 +2389,12 @@ de_nas_5gs_sm_5gsm_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, NULL }; + proto_tree_add_bitmask_list(tree, tvb, curr_offset, 1, flags, ENC_BIG_ENDIAN); + curr_offset++; - proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags, ENC_BIG_ENDIAN); + EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_nas_5gs_extraneous_data); - return 1; + return (curr_offset - offset); } /* -- cgit v1.2.3