aboutsummaryrefslogtreecommitdiffstats
path: root/packet-isakmp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-12-10 10:47:24 +0000
committerGuy Harris <guy@alum.mit.edu>2003-12-10 10:47:24 +0000
commit2a8afde2fd90445229730a6a53193f9accd8d10f (patch)
treeabc1f990f40dc3104c5beb1414582ff562da18e0 /packet-isakmp.c
parente42f094023a148770a191c242d90e8b47896d259 (diff)
Check whether the packet length is less than the length of the packet
header, and give up if it is. svn path=/trunk/; revision=9227
Diffstat (limited to 'packet-isakmp.c')
-rw-r--r--packet-isakmp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/packet-isakmp.c b/packet-isakmp.c
index d9b216c766..86172b17b2 100644
--- a/packet-isakmp.c
+++ b/packet-isakmp.c
@@ -4,7 +4,7 @@
* for ISAKMP (RFC 2407)
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
*
- * $Id: packet-isakmp.c,v 1.74 2003/12/02 18:35:36 guy Exp $
+ * $Id: packet-isakmp.c,v 1.75 2003/12/10 10:47:24 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -520,6 +520,13 @@ dissect_isakmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"Message ID: 0x%s", tvb_bytes_to_str(tvb, offset, sizeof(hdr.message_id)));
offset += sizeof(hdr.message_id);
+ if (hdr.length < sizeof(hdr)) {
+ proto_tree_add_text(isakmp_tree, tvb, offset, sizeof(hdr.length),
+ "Length: (bogus, length is %u, should be at least %u)",
+ hdr.length, sizeof(hdr));
+ return;
+ }
+
proto_tree_add_text(isakmp_tree, tvb, offset, sizeof(hdr.length),
"Length: %u", hdr.length);
offset += sizeof(hdr.length);