From b4020a83d14c4aa6d5a31ce9957cb7f1aaddcf58 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Wed, 11 Dec 2013 18:47:15 +0000 Subject: From Michael Lum via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9550 : GSM SMS UDH EMS control expects 4 octets instead of 3 with OPTIONAL 4th svn path=/trunk/; revision=53940 --- epan/dissectors/packet-gsm_sms.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'epan') diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c index edfabf3377..1ad9fc87ae 100644 --- a/epan/dissectors/packet-gsm_sms.c +++ b/epan/dissectors/packet-gsm_sms.c @@ -2093,7 +2093,7 @@ dis_iei_tf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 length) proto_tree *subtree_colour; - EXACT_DATA_CHECK(length, 4); + SHORT_DATA_CHECK(length, 3); oct = tvb_get_guint8(tvb, offset); proto_tree_add_text(tree, tvb, offset, 1, @@ -2178,23 +2178,28 @@ dis_iei_tf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 length) oct & 0x80 , str); offset++; - oct = tvb_get_guint8(tvb, offset); - item_colour = proto_tree_add_text(tree, tvb, offset, 1, "Text Colour"); - subtree_colour = proto_item_add_subtree(item_colour, ett_udh_tfc); + if (length > 3) + { + oct = tvb_get_guint8(tvb, offset); + item_colour = proto_tree_add_text(tree, tvb, offset, 1, "Text Colour"); + subtree_colour = proto_item_add_subtree(item_colour, ett_udh_tfc); - str = val_to_str_ext_const(oct & 0x0f, &text_color_values_ext, "Unknown"); - proto_tree_add_text(subtree_colour, tvb, offset, 1, - "Foreground Colour : 0x%x %s", - oct & 0x0f , str); - str = val_to_str_ext_const((oct >> 4) & 0x0f, &text_color_values_ext, "Unknown"); - proto_tree_add_text(subtree_colour, - tvb, offset, 1, - "Background Colour : 0x%x %s", - (oct >> 4) & 0x0f , str); + str = val_to_str_ext_const(oct & 0x0f, &text_color_values_ext, "Unknown"); + proto_tree_add_text(subtree_colour, tvb, offset, 1, + "Foreground Colour : 0x%x %s", + oct & 0x0f , str); + str = val_to_str_ext_const((oct >> 4) & 0x0f, &text_color_values_ext, "Unknown"); + proto_tree_add_text(subtree_colour, + tvb, offset, 1, + "Background Colour : 0x%x %s", + (oct >> 4) & 0x0f , str); + + offset++; + } } /* 9.2.3.24.10.1.2 */ @@ -3777,7 +3782,7 @@ proto_register_gsm_sms(void) }; /* Setup protocol subtree array */ -#define NUM_INDIVIDUAL_PARMS 12 +#define NUM_INDIVIDUAL_PARMS 14 gint *ett[NUM_INDIVIDUAL_PARMS/*+NUM_MSGS*/+NUM_UDH_IEIS+2]; ett[0] = &ett_gsm_sms; @@ -3792,6 +3797,8 @@ proto_register_gsm_sms(void) ett[9] = &ett_dcs; ett[10] = &ett_ud; ett[11] = &ett_udh; + ett[12] = &ett_udh_tfm; + ett[13] = &ett_udh_tfc; last_offset = NUM_INDIVIDUAL_PARMS; -- cgit v1.2.3