From 80c7d9288da572d18672280c49b1ea5ec3655f65 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 4 Apr 2001 02:52:04 +0000 Subject: Add, as per Tim Newsham, code to forcibly set the payload length to 4 (the minimum) if it's less than 4; also, add code to put a note that the payload length is bogus into the protocol tree. svn path=/trunk/; revision=3253 --- packet-isakmp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'packet-isakmp.c') diff --git a/packet-isakmp.c b/packet-isakmp.c index 6195f34c90..54a30a9ecb 100644 --- a/packet-isakmp.c +++ b/packet-isakmp.c @@ -3,7 +3,7 @@ * (ISAKMP) (RFC 2408) * Brad Robel-Forrest * - * $Id: packet-isakmp.c,v 1.36 2001/02/28 10:22:29 guy Exp $ + * $Id: packet-isakmp.c,v 1.37 2001/04/04 02:52:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -336,7 +336,7 @@ dissect_isakmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) &next_payload, &payload_length, isakmp_tree); if (ntree == NULL) break; - if (payload_length >= 4) { + if (payload_length >= 4) { /* XXX = > 4? */ if (payload < NUM_LOAD_TYPES) { if (next_payload == LOAD_TYPE_TRANSFORM) dissect_transform(tvb, offset + 4, payload_length - 4, ntree, 0); @@ -349,6 +349,12 @@ dissect_isakmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Payload"); } } + else { + proto_tree_add_text(ntree, tvb, offset + 4, 0, + "Payload (bogus, length is %u, must be at least 4)", + payload_length); + payload_length = 4; + } offset += payload_length; len -= payload_length; } -- cgit v1.2.3