According to ITU/X.25 (refer to table G.2), only the bits 1 to 6
authordeniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 16 Feb 2003 20:55:10 +0000 (20:55 +0000)
committerdeniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 16 Feb 2003 20:55:10 +0000 (20:55 +0000)
represent the number of semi-octets in the calling/called address
extension facility. So bits 7 and 8 shall be masked.
This fix avoids an incorrect detection of malformed packets.

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

packet-x25.c

index 863141f4e6606256a36ce05ea3069e4551a3f5ed..cd52d02ccfadce8108138d0a2fe883cfbe1a7306 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for X.25 packet disassembly
  * Olivier Abad <oabad@noos.fr>
  *
- * $Id: packet-x25.c,v 1.76 2003/01/31 03:17:47 guy Exp $
+ * $Id: packet-x25.c,v 1.77 2003/02/16 20:55:10 deniel Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1003,7 +1003,7 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb)
                    byte1 = tvb_get_guint8(tvb, *offset+1);
                    proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
                            "Length : %u", byte1);
-                   byte2 = tvb_get_guint8(tvb, *offset+2);
+                   byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F;
                    proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
                            "Number of semi-octets in DTE address : %u", byte2);
                    for (i = 0; i < byte2; i++) {
@@ -1036,7 +1036,7 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb)
                    byte1 = tvb_get_guint8(tvb, *offset+1);
                    proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
                            "Length : %u", byte1);
-                   byte2 = tvb_get_guint8(tvb, *offset+2);
+                   byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F;
                    proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
                            "Number of semi-octets in DTE address : %u", byte2);
                    for (i = 0; i < byte2; i++) {