aboutsummaryrefslogtreecommitdiffstats
path: root/packet-isakmp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-04-04 02:52:04 +0000
committerGuy Harris <guy@alum.mit.edu>2001-04-04 02:52:04 +0000
commit80c7d9288da572d18672280c49b1ea5ec3655f65 (patch)
treef38b40332dd3e6ff4c19b5ad4dc957d22a4c41e4 /packet-isakmp.c
parentf5e3edc13248ecec21ae65afff36b5571c826b66 (diff)
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
Diffstat (limited to 'packet-isakmp.c')
-rw-r--r--packet-isakmp.c10
1 files changed, 8 insertions, 2 deletions
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 <brad.robel-forrest@watchguard.com>
*
- * $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 <gerald@zing.org>
@@ -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;
}