pidgin.vv: e090488f: Stop crash when there are no candidates ...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Wed Feb 25 15:50:27 EST 2009


-----------------------------------------------------------------
Revision: e090488f9c17a046779cefd92da66b52e9b854cb
Ancestor: 6576ff8b014616e6a3d9d80dbeb652a50c48dbe6
Author: maiku at soc.pidgin.im
Date: 2009-02-25T09:20:20
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/e090488f9c17a046779cefd92da66b52e9b854cb

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

ChangeLog: 

Stop crash when there are no candidates set.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/iceudp.c	3d4a71b020e4e46f155c16ac053f2523e938ef2c
+++ libpurple/protocols/jabber/jingle/iceudp.c	b3926f714def77ee4879e676e5885f6ccd95320f
@@ -334,10 +334,14 @@ jingle_iceudp_to_xml_internal(JingleTran
 
 	if (action == JINGLE_SESSION_INITIATE || action == JINGLE_TRANSPORT_INFO ||
 			action == JINGLE_CONTENT_ADD || action == JINGLE_TRANSPORT_REPLACE) {
-		JingleIceUdpCandidate *candidate = JINGLE_ICEUDP_GET_PRIVATE(
-				transport)->local_candidates->data;
-		xmlnode_set_attrib(node, "pwd", candidate->password);
-		xmlnode_set_attrib(node, "ufrag", candidate->username);
+		JingleIceUdpPrivate *icetransport =
+				JINGLE_ICEUDP_GET_PRIVATE(transport);
+		if (icetransport && icetransport->local_candidates) {
+			JingleIceUdpCandidate *candidate =
+					icetransport->local_candidates->data;
+			xmlnode_set_attrib(node, "pwd", candidate->password);
+			xmlnode_set_attrib(node, "ufrag", candidate->username);
+		}
 	}
 
 	if (action == JINGLE_TRANSPORT_INFO || action == JINGLE_SESSION_ACCEPT) {


More information about the Commits mailing list