Ethereal-dev: [Ethereal-dev] [patch] packet-afp.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: didier <dgautheron@xxxxxxxx>
Date: Tue, 17 Sep 2002 23:23:27 +0000
Hi
If the packet is malformed bail out early (before allocating 32000 subtrees for example).

BTW How do I do if I want to reset a conversation eg:
in the same capture:
A)
ip1:pt1 --> ip2:pt2
ip1:pt1 --> ip2:pt2 <RST>
some stuff
B)
ip1:pt1 --> ip2:pt2 <SYN>
....
now A and B are in the same conversation

Didier
Index: packet-afp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-afp.c,v
retrieving revision 1.21
diff -u -B -r1.21 packet-afp.c
--- packet-afp.c	2002/08/28 21:00:06	1.21
+++ packet-afp.c	2002/09/17 22:50:43
@@ -1574,6 +1577,8 @@
 		org = offset;
 		name = NULL;
 		size = tvb_get_guint8(tvb, offset) +add;
+		if (!size)
+			return offset;	/* packet is malformed */
 		flags = tvb_get_guint8(tvb, offset +1);
 
 		if (ptree) {