pidgin: 85876876: Fix FT context header length handling. T...

qulogic at pidgin.im qulogic at pidgin.im
Sun Feb 28 00:52:58 EST 2010


-----------------------------------------------------------------
Revision: 8587687655d4e11f0965358e8a4378cfa3d1e4e7
Ancestor: aa056474065ea41aee1d6b2e6a4c0d2877edb0e4
Author: qulogic at pidgin.im
Date: 2010-02-28T04:06:46
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8587687655d4e11f0965358e8a4378cfa3d1e4e7

Modified files:
        libpurple/protocols/msn/slp.c
        libpurple/protocols/msn/slplink.c

ChangeLog: 

Fix FT context header length handling. The official client only seems to
care about this value if the version is 3.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slp.c	83b07712450edaf1d724b79d4155fadcc2c3b766
+++ libpurple/protocols/msn/slp.c	8347895b2576ff2044f0fe63e29f0e464084bf83
@@ -397,8 +397,8 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 
 		header = (MsnFileContext *)purple_base64_decode(context, &bin_len);
 		if (bin_len >= sizeof(MsnFileContext) - 1 &&
-		    header->length == sizeof(MsnFileContext) - 1 &&
-		    header->version == 2) {
+			(header->version == 2 ||
+			 (header->version == 3 && header->length == sizeof(MsnFileContext) + 63))) {
 			file_size = GUINT64_FROM_LE(header->file_size);
 
 			file_name = g_convert((const gchar *)&header->file_name,
============================================================
--- libpurple/protocols/msn/slplink.c	c86fbf7c17625a6e9c9e4b7f3db8c508d3a91bb0
+++ libpurple/protocols/msn/slplink.c	42477d0a16d37a8c1e662dc4218afad270649fad
@@ -686,7 +686,7 @@ gen_context(PurpleXfer *xfer, const char
 		u8 = NULL;
 	}
 
-	header.length = GUINT32_TO_LE(sizeof(MsnFileContext));
+	header.length = GUINT32_TO_LE(sizeof(MsnFileContext) - 1);
 	header.version = GUINT32_TO_LE(2); /* V.3 contains additional unnecessary data */
 	header.file_size = GUINT64_TO_LE(size);
 	header.type = GUINT32_TO_LE(1);    /* No file preview */


More information about the Commits mailing list