[asterisk-commits] trunk r32674 - /trunk/res/res_jabber.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jun 6 12:18:44 MST 2006


Author: mogorman
Date: Tue Jun  6 14:18:44 2006
New Revision: 32674

URL: http://svn.digium.com/view/asterisk?rev=32674&view=rev
Log:
fix a potential segfault

Modified:
    trunk/res/res_jabber.c

Modified: trunk/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_jabber.c?rev=32674&r1=32673&r2=32674&view=diff
==============================================================================
--- trunk/res/res_jabber.c (original)
+++ trunk/res/res_jabber.c Tue Jun  6 14:18:44 2006
@@ -811,7 +811,11 @@
 	buddy = ASTOBJ_CONTAINER_FIND(&client->buddies, pak->from->partial);
 
 	resource = aji_find_resource(buddy, pak->from->resource);
-
+	if (!resource) {
+		ast_log(LOG_NOTICE,"JABBER: Received client info from %s when not requested.\n", pak->from->full);
+		ASTOBJ_UNREF(client, aji_client_destroy);
+		return IKS_FILTER_EAT;
+	}	
 	if (pak->subtype == IKS_TYPE_RESULT) {
 		if (iks_find_with_attrib(pak->query, "feature", "var", "http://www.google.com/xmpp/protocol/voice/v1")) {
 			resource->cap->jingle = 1;
@@ -837,8 +841,8 @@
 			iks_insert_attrib(google, "var", "http://www.google.com/xmpp/protocol/voice/v1");
 			iks_insert_node(iq, query);
 			iks_insert_node(query, ident);
+			iks_insert_node(query, google);
 			iks_insert_node(query, disco);
-			iks_insert_node(query, google);
 			iks_send(client->p, iq);
 		} else
 			ast_log(LOG_ERROR, "Out of Memory.\n");



More information about the asterisk-commits mailing list