aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2004-12-09 18:46:27 +0000
committerGerald Combs <gerald@wireshark.org>2004-12-09 18:46:27 +0000
commitd888d28671ab5c8dbb280c95fa0761fe1f3e968a (patch)
tree30218057894ae56e7584cc9c4b4b1c90aeb71e7c
parentc3a4d2b14f5ce5a4823fbc86e760c0e785cec428 (diff)
Check for a bogus byte length.
svn path=/trunk/; revision=12698
-rw-r--r--epan/dissectors/packet-x25.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c
index fb2427f07d..666a7138be 100644
--- a/epan/dissectors/packet-x25.c
+++ b/epan/dissectors/packet-x25.c
@@ -1026,8 +1026,14 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb)
}
}
tmpbuf[i] = 0;
- proto_tree_add_text(fac_subtree, tvb, *offset+4, byte1 - 2,
- "DTE address : %s", tmpbuf);
+ if (byte1 < 2) {
+ proto_tree_add_text(fac_subtree, tvb, 0, 0,
+ "Bogus byte length : %d", byte1);
+ return;
+ } else {
+ proto_tree_add_text(fac_subtree, tvb, *offset+4, byte1 - 2,
+ "DTE address : %s", tmpbuf);
+ }
}
break;
case X25_FAC_CALLING_ADDR_EXT: