From: Michael Jerris Date: Mon, 22 Jun 2009 14:12:35 +0000 (+0000) Subject: mod_sofia: fix segfault on refer with no content-type or body (SFSIP-153) X-Git-Tag: v1.0.4~391 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11d53ae7dcc1b56e7cd220378fc095f29297ca69;p=thirdparty%2Ffreeswitch.git mod_sofia: fix segfault on refer with no content-type or body (SFSIP-153) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13889 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index ac5b1deee0..163ca79163 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -126,7 +126,11 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status, } /* For additional NOTIFY event packages see http://www.iana.org/assignments/sip-events. */ - if (!strcasecmp(sip->sip_event->o_type, "refer")) { + if (sip->sip_content_type && + sip->sip_content_type->c_type && + sip->sip_payload && + sip->sip_payload->pl_data && + !strcasecmp(sip->sip_event->o_type, "refer")) { if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_NOTIFY_REFER) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "content-type", sip->sip_content_type->c_type); switch_event_add_body(s_event, "%s", sip->sip_payload->pl_data);