aboutsummaryrefslogtreecommitdiffstats
path: root/packet-aarp.c
diff options
context:
space:
mode:
authorLaurent Deniel <laurent.deniel@free.fr>1999-10-03 15:21:11 +0000
committerLaurent Deniel <laurent.deniel@free.fr>1999-10-03 15:21:11 +0000
commit5084625f9b2965a0b9c6b5eafe8725ebc06d96f5 (patch)
tree5d228be9c98b8c6cee38cd9088171ae17ea1ff27 /packet-aarp.c
parentc30bd276012ab4e6fc1780db8d6452d36d55c7ec (diff)
Oops, forgot to check truncated header.
Please, please in new dissector routines, check for truncated packets, especially when string operations or loop on bytes are used (to avoid display of erroneous data and infinite loop or segmentation violation) ! svn path=/trunk/; revision=763
Diffstat (limited to 'packet-aarp.c')
-rw-r--r--packet-aarp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/packet-aarp.c b/packet-aarp.c
index 31739e82d4..649c884b1d 100644
--- a/packet-aarp.c
+++ b/packet-aarp.c
@@ -1,7 +1,7 @@
/* packet-aarp.c
* Routines for Appletalk ARP packet disassembly
*
- * $Id: packet-aarp.c,v 1.9 1999/10/03 15:06:27 deniel Exp $
+ * $Id: packet-aarp.c,v 1.10 1999/10/03 15:21:11 deniel Exp $
*
* Simon Wilkinson <sxw@dcs.ed.ac.uk>
*
@@ -94,6 +94,11 @@ dissect_aarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
{AARP_PROBE, "AARP probe" },
{0, NULL } };
+ if (!BYTES_ARE_IN_FRAME(offset, sizeof(e_ether_aarp))) {
+ dissect_data(pd, offset, fd, tree);
+ return;
+ }
+
ea.htype = pntohs(&pd[offset]);
ea.ptype = pntohs(&pd[offset + 2]);
ea.halen = (guint8) pd[offset + 4];