From: Brian West Date: Mon, 2 Feb 2009 07:27:04 +0000 (+0000) Subject: segfault if these are empty... found this playing with the Cisco 7975 X-Git-Tag: v1.0.3~495 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdd4e9a79d373264a81e2a2f88064c1d0d402478;p=thirdparty%2Ffreeswitch.git segfault if these are empty... found this playing with the Cisco 7975 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11592 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 46d2b4dc0e..d482a5ab30 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1517,7 +1517,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, /* 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 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n /* 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; }