aboutsummaryrefslogtreecommitdiffstats
path: root/packet-aarp.c
diff options
context:
space:
mode:
authordeniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7>1999-10-03 15:21:11 +0000
committerdeniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7>1999-10-03 15:21:11 +0000
commita29f9f35b9e0e9963d68b1fb2d32b8b31632a98b (patch)
tree5d228be9c98b8c6cee38cd9088171ae17ea1ff27 /packet-aarp.c
parent091b722c30d88b60ddc4c234a68c4b22221673d3 (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) ! git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@763 f5534014-38df-0310-8fa8-9805f1628bb7
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];