aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x25.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-x25.c')
-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: