Prevent a crash in res_pjsip_dtmf_info.c

This change makes sure that a content type header exists before
checking the contents of the header against known SIP INFO DTMF content
types.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2013-09-03 18:08:20 +00:00
parent 0b78a83eb3
commit bf15a5d488

View File

@@ -34,8 +34,9 @@
static int is_media_type(pjsip_rx_data *rdata, char *subtype)
{
return !pj_strcmp2(&rdata->msg_info.ctype->media.type, "application") &&
!pj_strcmp2(&rdata->msg_info.ctype->media.subtype, subtype);
return rdata->msg_info.ctype
&& !pj_strcmp2(&rdata->msg_info.ctype->media.type, "application")
&& !pj_strcmp2(&rdata->msg_info.ctype->media.subtype, subtype);
}
static void send_response(struct ast_sip_session *session,