GSM SMS: do not call GSM SMS port IE subdissectors until message is reassembled
authorPascal Quantin <pascal.quantin@gmail.com>
Wed, 21 Oct 2015 11:57:40 +0000 (13:57 +0200)
committerPascal Quantin <pascal.quantin@gmail.com>
Wed, 21 Oct 2015 13:57:54 +0000 (13:57 +0000)
Change-Id: Ibf384c01a1d3283e36b87a3d84e6c256341b8664
Reviewed-on: https://code.wireshark.org/review/11190
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
epan/dissectors/packet-gsm_sms.c

index 5c84776d311ff69d025f4581502843c227203b6d..68179d3f18119a57a18ddb3f097f4c0dc7b98f19 100644 (file)
@@ -1933,13 +1933,16 @@ dis_field_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset
         }
         else if (eight_bit)
         {
-            /* proto_tree_add_format_text(subtree, tvb, offset, length); */
-            if (! dissector_try_uint(gsm_sms_dissector_tbl, udh_fields.port_src, sm_tvb, pinfo, subtree))
-            {
-                if (! dissector_try_uint(gsm_sms_dissector_tbl, udh_fields.port_dst,sm_tvb, pinfo, subtree))
+            if (!is_fragmented || (reassembled && pinfo->fd->num == reassembled_in)) {
+                if (! dissector_try_uint(gsm_sms_dissector_tbl, udh_fields.port_src, sm_tvb, pinfo, subtree))
                 {
-                    proto_tree_add_item(subtree, hf_gsm_sms_body, tvb, offset, length, ENC_NA);
+                    if (! dissector_try_uint(gsm_sms_dissector_tbl, udh_fields.port_dst,sm_tvb, pinfo, subtree))
+                    {
+                        proto_tree_add_item(subtree, hf_gsm_sms_body, tvb, offset, length, ENC_NA);
+                    }
                 }
+            } else {
+                proto_tree_add_item(subtree, hf_gsm_sms_body, tvb, offset, length, ENC_NA);
             }
         }
         else if (ucs2)