aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_sms.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2013-12-11 18:47:15 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2013-12-11 18:47:15 +0000
commitb4020a83d14c4aa6d5a31ce9957cb7f1aaddcf58 (patch)
tree1187fe9d289a764700b80ee7ab895778f04591d5 /epan/dissectors/packet-gsm_sms.c
parent95b25a44ccf3e6cfb7acda5f3cc4bf2f780aa5a7 (diff)
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
Diffstat (limited to 'epan/dissectors/packet-gsm_sms.c')
-rw-r--r--epan/dissectors/packet-gsm_sms.c35
1 files changed, 21 insertions, 14 deletions
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;