Ignore short packets related to p2pv2.
authorElliott Sales de Andrade <qulogic@pidgin.im>
Mon, 27 Dec 2010 03:08:45 +0000
changeset26fc2e71129a pushlog
parent 863d71f95fef
child 8c04aac8b737
Ignore short packets related to p2pv2.


committer: John Bailey <rekkanoryo@rekkanoryo.org>
libpurple/protocols/msn/directconn.c
      1.1 --- a/libpurple/protocols/msn/directconn.c
      1.2 +++ b/libpurple/protocols/msn/directconn.c
      1.3 @@ -601,8 +601,10 @@
      1.4  
      1.5  		if (dc->header.length) {
      1.6  			part = msn_slpmsgpart_new_from_data(dc->in_buffer + 4, dc->header.length);
      1.7 -			msn_slplink_process_msg(dc->slplink, part);
      1.8 -			msn_slpmsgpart_unref(part);
      1.9 +			if (part) {
     1.10 +				msn_slplink_process_msg(dc->slplink, part);
     1.11 +				msn_slpmsgpart_unref(part);
     1.12 +			}
     1.13  		}
     1.14  
     1.15  		/*
     1.16 @@ -674,7 +676,7 @@
     1.17  		if (dc->in_pos < 4 + packet_length)
     1.18  			return;
     1.19  
     1.20 -		if (dc->state != DC_STATE_FOO) {
     1.21 +		if (dc->state != DC_STATE_FOO && packet_length >= P2P_PACKET_HEADER_SIZE) {
     1.22  			MsnP2PHeader *context;
     1.23  			
     1.24  			/* Skip packet size */