[Freeswitch-svn] [commit] r11592 - freeswitch/trunk/src/mod/endpoints/mod_sofia

FreeSWITCH SVN brian at freeswitch.org
Sun Feb 1 23:27:04 PST 2009


Author: brian
Date: Mon Feb  2 01:27:04 2009
New Revision: 11592

Log:
segfault if these are empty... found this playing with the Cisco 7975

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	Mon Feb  2 01:27:04 2009
@@ -1517,7 +1517,7 @@
 
 		/* the following could be refactored back to the calling event handler in sofia.c XXX MTK */
 		if (profile->manage_shared_appearance) {
-			if (!strncmp(sip->sip_request->rq_url->url_user, "sla-agent", sizeof("sla-agent"))) {
+			if (sip->sip_request->rq_url->url_user && !strncmp(sip->sip_request->rq_url->url_user, "sla-agent", sizeof("sla-agent"))) {
 				/* only fire this on <200 to try to avoid resubscribes. probably better ways to do this? */
 				if (status < 200) {
 					sofia_sla_handle_sip_i_subscribe(nua, contact_str, profile, nh, sip, tags);
@@ -1837,7 +1837,7 @@
 		/* the following could instead be refactored back to the calling event handler in sofia.c XXX MTK */
 		if (profile->manage_shared_appearance) {
 			/* also it probably is unsafe to dereference so many things in a row without testing XXX MTK */
-			if (!strncmp(sip->sip_request->rq_url->url_user, "sla-agent", sizeof("sla-agent"))) {
+			if (sip->sip_request->rq_url->url_user && !strncmp(sip->sip_request->rq_url->url_user, "sla-agent", sizeof("sla-agent"))) {
 				sofia_sla_handle_sip_i_publish(nua, profile, nh, sip, tags);
 				return;
 			}



More information about the Freeswitch-svn mailing list