[asterisk-commits] seanbright: branch group/pimp_my_sip r388695 - /team/group/pimp_my_sip/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 14 12:38:43 CDT 2013


Author: seanbright
Date: Tue May 14 12:38:41 2013
New Revision: 388695

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388695
Log:
Don't crash if we aren't sent a Content-Type header

Modified:
    team/group/pimp_my_sip/res/res_sip_dtmf_info.c
    team/group/pimp_my_sip/res/res_sip_messaging.c
    team/group/pimp_my_sip/res/res_sip_sdp_rtp.c

Modified: team/group/pimp_my_sip/res/res_sip_dtmf_info.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_dtmf_info.c?view=diff&rev=388695&r1=388694&r2=388695
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_dtmf_info.c (original)
+++ team/group/pimp_my_sip/res/res_sip_dtmf_info.c Tue May 14 12:38:41 2013
@@ -45,6 +45,10 @@
 
 	char event = '\0';
 	unsigned int duration = 0;
+
+	if (!&body->content_type) {
+		return 0;
+	}
 
 	if (pj_strcmp2(&body->content_type.type, "application") ||
 	    pj_strcmp2(&body->content_type.subtype, "dtmf-relay")) {

Modified: team/group/pimp_my_sip/res/res_sip_messaging.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_messaging.c?view=diff&rev=388695&r1=388694&r2=388695
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_messaging.c (original)
+++ team/group/pimp_my_sip/res/res_sip_messaging.c Tue May 14 12:38:41 2013
@@ -80,6 +80,10 @@
  */
 static enum pjsip_status_code check_content_type(const pjsip_rx_data *rdata)
 {
+	if (!&rdata->msg_info.msg->body->content_type) {
+		return PJSIP_SC_UNSUPPORTED_MEDIA_TYPE;
+	}
+
 	if (pj_strcmp2(&rdata->msg_info.msg->body->content_type.type, "text") ||
 	    pj_strcmp2(&rdata->msg_info.msg->body->content_type.subtype, "plain")) {
 		return PJSIP_SC_UNSUPPORTED_MEDIA_TYPE;

Modified: team/group/pimp_my_sip/res/res_sip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_sdp_rtp.c?view=diff&rev=388695&r1=388694&r2=388695
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_sdp_rtp.c (original)
+++ team/group/pimp_my_sip/res/res_sip_sdp_rtp.c Tue May 14 12:38:41 2013
@@ -921,6 +921,10 @@
 	struct pjsip_transaction *tsx = pjsip_rdata_get_tsx(rdata);
 	pjsip_tx_data *tdata;
 
+	if (!&rdata->msg_info.msg->body->content_type) {
+		return 0;
+	}
+
 	if (pj_strcmp2(&rdata->msg_info.msg->body->content_type.type, "application") ||
 	    pj_strcmp2(&rdata->msg_info.msg->body->content_type.subtype, "media_control+xml")) {
 




More information about the asterisk-commits mailing list