In "dissect_tcap_tid()", check that the length of the transaction ID is
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 20 Mar 2004 07:26:41 +0000 (07:26 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 20 Mar 2004 07:26:41 +0000 (07:26 +0000)
<= 4, so we don't copy more than 4 bytes to a 4-byte integer.

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

packet-tcap.c

index 05e735bbb34d721376578c7f17ee769fc6a85ee5..3929ffd0492b1531841897ab7895bb228be9e8b6 100644 (file)
@@ -9,7 +9,7 @@
  *
  * (append your name here for newer version)
  *
- * $Id: packet-tcap.c,v 1.9 2004/03/19 07:54:57 guy Exp $
+ * $Id: packet-tcap.c,v 1.10 2004/03/20 07:26:41 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -378,6 +378,21 @@ dissect_tcap_tid(ASN1_SCK *asn1, proto_tree *tcap_tree, proto_item *ti, int type
 
     dissect_tcap_len(asn1, subtree, &def_len, &len);
 
+    /*
+     * XXX - this is, I think, an OCTET STRING (SIZE(1..4)); should it
+     * just be put into the protocol tree as an FT_BYTES value and
+     * displayed in the Info column with "bytes_to_str()"?
+     *
+     * If so, should we have separate hf_tcap_source_tid and
+     * hf_tcap_destination_tid?
+     *
+     * Does that apply to other transaction IDs?
+     */
+    if (len > 4)
+    {
+       return TC_DS_FAIL;
+    }
+
     saved_offset = asn1->offset;
     ret = asn1_string_value_decode(asn1, len, &poctets);
     val = 0;