Wireshark packet-gtp.c error in decoding IMEI.
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 3 Sep 2007 16:42:28 +0000 (16:42 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 3 Sep 2007 16:42:28 +0000 (16:42 +0000)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1536

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22779 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-gtp.c

index 747403df648905c5c1e2c6a5fd91c6f490b5033f..869b3cd8a98a37d795bdb3526768e13f4a7e7573 100644 (file)
@@ -4843,6 +4843,8 @@ decode_gtp_imeisv(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree
        guint16         length;
        proto_tree      *ext_imeisv;
        proto_item      *te;
+       tvbuff_t        *next_tvb;
+       char            *digit_str;
 
        length = tvb_get_ntohs(tvb, offset+1);
        te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_IMEISV, gtp_val, "Unknown"));
@@ -4858,7 +4860,9 @@ decode_gtp_imeisv(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree
         * then the IMEI shall be placed in the IMEI(SV) field and the last semi-octet of octet 11 shall be
         * set to '1111'. Both IMEI and IMEISV are BCD encoded.
         */
-       proto_tree_add_item(ext_imeisv, hf_gtp_ext_imeisv, tvb, offset, length, FALSE);
+       next_tvb = tvb_new_subset(tvb, offset, length, length);
+       digit_str = unpack_digits(next_tvb, 0);
+       proto_tree_add_string(tree, hf_gtp_ext_imeisv, next_tvb, 0, -1, digit_str);
        
        return 3 + length;
 }
@@ -6071,7 +6075,7 @@ proto_register_gtp(void)
                },
                { &hf_gtp_ext_imeisv,
                        { "IMEI(SV)", "gtp.ext_imeisv",
-                       FT_BYTES, BASE_NONE, NULL, 0x0,
+                       FT_STRING, BASE_NONE, NULL, 0x0,
                        "IMEI(SV)", HFILL }
                },
                { &hf_gtp_targetid,