soc.2008.vv: 8eb9845f: Fix crash when receiving a session-initi...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sat Jun 7 16:20:48 EDT 2008


-----------------------------------------------------------------
Revision: 8eb9845f9ef20e147ed50e3daffbad3581963ade
Ancestor: ebdf5b47d519505babea6d71794f2b59c4db8173
Author: maiku at soc.pidgin.im
Date: 2008-06-07T20:16:06
Branch: im.pidgin.soc.2008.vv
URL: http://d.pidgin.im/viewmtn/revision/info/8eb9845f9ef20e147ed50e3daffbad3581963ade

Modified files:
        libpurple/protocols/jabber/jingle.c

ChangeLog: 

Fix crash when receiving a session-initiate ack for a nonexistent session.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle.c	02929ba31cf30d6d9e2ef3b8bafdf2ba95379ec3
+++ libpurple/protocols/jabber/jingle.c	ab4c50313a357bdeaddadb3717595faf28a0b2a1
@@ -992,9 +992,18 @@ jabber_jingle_session_initiate_result_cb
 {
 	const char *from = xmlnode_get_attrib(packet, "from");
 	JingleSession *session = jabber_jingle_session_find_by_jid(js, from);
-	PurpleMedia *media = session->media;
+	PurpleMedia *media;
 	GList *contents;
 
+	if (!session) {
+		/* respond with an error here */
+		purple_debug_error("jingle", "Received session-initiate ack"
+				   " to nonexistent session\n");
+		return;
+	}
+
+	media = session->media;
+
 	if (!strcmp(xmlnode_get_attrib(packet, "type"), "error")) {
 		purple_media_got_hangup(media);
 		return;


More information about the Commits mailing list