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

FreeSWITCH SVN mikej at freeswitch.org
Mon Jun 22 07:12:35 PDT 2009


Author: mikej
Date: Mon Jun 22 09:12:35 2009
New Revision: 13889

Log:
mod_sofia: fix segfault on refer with no content-type or body (SFSIP-153)

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

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Mon Jun 22 09:12:35 2009
@@ -126,7 +126,11 @@
 	}
 
 	/* 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);



More information about the Freeswitch-svn mailing list