changeset 31512:455406966695

Ignore short packets related to p2pv2. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 27 Dec 2010 03:08:45 +0000
parents 880b63331cb0
children 86f4fd7be883
files libpurple/protocols/msn/directconn.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/directconn.c	Thu Dec 23 07:06:33 2010 +0000
+++ b/libpurple/protocols/msn/directconn.c	Mon Dec 27 03:08:45 2010 +0000
@@ -601,8 +601,10 @@
 
 		if (dc->header.length) {
 			part = msn_slpmsgpart_new_from_data(dc->in_buffer + 4, dc->header.length);
-			msn_slplink_process_msg(dc->slplink, part);
-			msn_slpmsgpart_unref(part);
+			if (part) {
+				msn_slplink_process_msg(dc->slplink, part);
+				msn_slpmsgpart_unref(part);
+			}
 		}
 
 		/*
@@ -674,7 +676,7 @@
 		if (dc->in_pos < 4 + packet_length)
 			return;
 
-		if (dc->state != DC_STATE_FOO) {
+		if (dc->state != DC_STATE_FOO && packet_length >= P2P_PACKET_HEADER_SIZE) {
 			MsnP2PHeader *context;
 			
 			/* Skip packet size */