soc.2010.msn-tlc: d69cf67a: Set the correct length of the data befor...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Wed Jul 7 21:41:35 EDT 2010


----------------------------------------------------------------------
Revision: d69cf67a92dca1d570bd214aac76805af1d1d703
Parent:   209cf23bbac37a5699d243b8461cb70d97587895
Author:   masca at cpw.pidgin.im
Date:     07/06/10 14:56:58
Branch:   im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/d69cf67a92dca1d570bd214aac76805af1d1d703

Changelog: 

Set the correct length of the data before calling the function to process it.

Changes against parent 209cf23bbac37a5699d243b8461cb70d97587895

  patched  libpurple/protocols/msn/msg.c
  patched  libpurple/protocols/msn/slplink.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msg.c	10a44697e267b08126d6240f0ef96167228e56d8
+++ libpurple/protocols/msn/msg.c	722c049914d84a9dcb77ce499aaee2c958fd2d4d
@@ -942,8 +942,12 @@ msn_p2p_msg(MsnCmdProc *cmdproc, MsnMess
 
 	data = msn_message_get_bin_data(msg, &len);
 
-	if (msg->part)
-		msn_slplink_process_msg(slplink, msg->part->header, data, len);
+	if (msg->part) {
+		len -= P2P_PACKET_HEADER_SIZE;
+		len -= P2P_PACKET_FOOTER_SIZE;
+
+		msn_slplink_process_msg(slplink, msg->part->header, data+P2P_PACKET_HEADER_SIZE, len);
+	}
 	else /* This should never happen. */
 		purple_debug_fatal("msn", "P2P message without a Part.\n");
 }
============================================================
--- libpurple/protocols/msn/slplink.c	71031668e2d795cc079f22357475ef022c9ec9fc
+++ libpurple/protocols/msn/slplink.c	6193dfd859461006a9cda8b9679f537dd74eda91
@@ -463,9 +463,6 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 	MsnSlpMessage *slpmsg;
 	guint64 offset;
 
-	len -= P2P_PACKET_HEADER_SIZE;
-	len -= P2P_PACKET_FOOTER_SIZE;
-
 	if (header->total_size < header->length)
 	{
 		/* We seem to have received a bad header */


More information about the Commits mailing list