cpw.malu.xmpp.jingle_ft: c6b28b24: Guard against a non-existent reason elem...

malu at pidgin.im malu at pidgin.im
Mon Apr 12 16:10:43 EDT 2010


-----------------------------------------------------------------
Revision: c6b28b243532a32b17994f19f95a6b151bd84adb
Ancestor: 1cdf3188c17ed2b801877e05a3830ec5576bcf94
Author: malu at pidgin.im
Date: 2010-04-12T20:05:27
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/c6b28b243532a32b17994f19f95a6b151bd84adb

Modified files:
        libpurple/protocols/jabber/jingle/file-transfer.c

ChangeLog: 

Guard against a non-existent reason element on session-terminate

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/file-transfer.c	0c4d77d100cebfbb3d558df3cbe0b7916110db5a
+++ libpurple/protocols/jabber/jingle/file-transfer.c	55bb434846cf8f1d5623e2a87dd65a3eafde8f6a
@@ -793,9 +793,10 @@ jingle_file_transfer_handle_action_inter
 			PurpleXfer *xfer = 
 				jingle_file_transfer_get_xfer(content);
 			xmlnode *reason = xmlnode_get_child(xmlcontent, "reason");
-			xmlnode *reason_code = reason->child;
+			xmlnode *reason_code = reason ? reason->child : NULL;
 			const gchar *reason_text =
-				reason_code->type == XMLNODE_TYPE_TAG ? reason_code->name : NULL;
+				reason_code && reason_code->type == XMLNODE_TYPE_TAG ?
+				reason_code->name : NULL;
 			
 			/* do stuff here... close transfer etc... */
 			if (xfer) {


More information about the Commits mailing list