aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-l2tp.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-04-28 19:42:56 +0000
committerGerald Combs <gerald@wireshark.org>2005-04-28 19:42:56 +0000
commita7082d41b0a8ebb96ac0b7db3d27eb25aaef2ec7 (patch)
tree7d5c9b447d7b78a9ab263e50b865e4a78989f909 /epan/dissectors/packet-l2tp.c
parent0be67943e6359016ec9b687fb33ec83b2b3d5dcd (diff)
Break out of an infinite loop. Fixes bug 138.
svn path=/trunk/; revision=14223
Diffstat (limited to 'epan/dissectors/packet-l2tp.c')
-rw-r--r--epan/dissectors/packet-l2tp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c
index fc265724ea..d8de5cc3d7 100644
--- a/epan/dissectors/packet-l2tp.c
+++ b/epan/dissectors/packet-l2tp.c
@@ -536,6 +536,12 @@ static void process_control_avps(tvbuff_t *tvb,
avp_vendor_id = tvb_get_ntohs(tvb, index + 2);
avp_type = tvb_get_ntohs(tvb, index + 4);
+ if (avp_len < 1) {
+ proto_tree_add_text(l2tp_avp_tree, tvb, index, 0,
+ "AVP length must be >= 1");
+ return;
+ }
+
if (avp_vendor_id == VENDOR_IETF) {
tf = proto_tree_add_text(l2tp_tree, tvb, index,
avp_len, "%s AVP",