pidgin: cb65f9e2: Fix crashes when filenames end up being ...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Tue Aug 18 11:51:19 EDT 2009


-----------------------------------------------------------------
Revision: cb65f9e268d74765e74e1b2c393027cfe8ae2ebd
Ancestor: e8604c1efc37413c8bfd4225bf24c534c4da8d57
Author: qulogic at pidgin.im
Date: 2009-08-16T23:46:15
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/cb65f9e268d74765e74e1b2c393027cfe8ae2ebd

Modified files:
        libpurple/protocols/bonjour/bonjour_ft.c
        libpurple/protocols/jabber/oob.c
        libpurple/protocols/msn/slp.c
        libpurple/protocols/msnp9/slp.c

ChangeLog: 

Fix crashes when filenames end up being NULL in some prpls.  Fixed a minor
leak in MSNP9 while we're at it.

-------------- next part --------------
============================================================
--- libpurple/protocols/bonjour/bonjour_ft.c	9035669b40c8dedff94e8eda828d60aeafe85ed3
+++ libpurple/protocols/bonjour/bonjour_ft.c	67118413ab01898b2c60045bb7deb0e1ca14ffb1
@@ -450,9 +450,11 @@ xep_si_parse(PurpleConnection *pc, xmlno
 
 				/* TODO: Make sure that it is advertising a bytestreams transfer */
 
-				bonjour_xfer_receive(pc, id, sid, name, filesize, filename, XEP_BYTESTREAMS);
+				if (filename) {
+					bonjour_xfer_receive(pc, id, sid, name, filesize, filename, XEP_BYTESTREAMS);
 
-				parsed_receive = TRUE;
+					parsed_receive = TRUE;
+				}
 			}
 
 			if (!parsed_receive) {
============================================================
--- libpurple/protocols/jabber/oob.c	d700c406a6100b21526b0991754fe41abd91a811
+++ libpurple/protocols/jabber/oob.c	2547d358659b7acb165b5ffb05dea278d1fa32c6
@@ -207,7 +207,10 @@ void jabber_oob_parse(JabberStream *js, 
 	url = xmlnode_get_data(urlnode);
 
 	jox = g_new0(JabberOOBXfer, 1);
-	purple_url_parse(url, &jox->address, &jox->port, &jox->page, NULL, NULL);
+	if (!purple_url_parse(url, &jox->address, &jox->port, &jox->page, NULL, NULL)) {
+		g_free(url);
+		return;
+	}
 	g_free(url);
 	jox->js = js;
 	jox->headers = g_string_new("");
============================================================
--- libpurple/protocols/msn/slp.c	ce3bc56388fb29196c5d12dae58cb875d2944ee5
+++ libpurple/protocols/msn/slp.c	6dad63f356b7e928a84fd0ba940016592c888953
@@ -351,7 +351,7 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 
 			g_free(bin);
 
-			purple_xfer_set_filename(xfer, file_name);
+			purple_xfer_set_filename(xfer, file_name ? file_name : "");
 			g_free(file_name);
 			purple_xfer_set_size(xfer, file_size);
 			purple_xfer_set_init_fnc(xfer, msn_xfer_init);
============================================================
--- libpurple/protocols/msnp9/slp.c	d9f32cedcbd873f775170b0d41200b327d359473
+++ libpurple/protocols/msnp9/slp.c	a8b5334f3c4bf93d827e8202c8968a01daf61c92
@@ -338,7 +338,7 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 		char *bin;
 		gsize bin_len;
 		guint32 file_size;
-		char *file_name;
+		gchar *file_name;
 		gunichar2 *uni_name;
 
 		account = slpcall->slplink->session->account;
@@ -368,7 +368,8 @@ got_sessionreq(MsnSlpCall *slpcall, cons
 
 			g_free(bin);
 
-			purple_xfer_set_filename(xfer, file_name);
+			purple_xfer_set_filename(xfer, file_name ? file_name : "");
+			g_free(file_name);
 			purple_xfer_set_size(xfer, file_size);
 			purple_xfer_set_init_fnc(xfer, msn_xfer_init);
 			purple_xfer_set_request_denied_fnc(xfer, msn_xfer_cancel);


More information about the Commits mailing list