From: Joshua Colp Date: Tue, 20 Aug 2013 11:33:43 +0000 (+0000) Subject: Remove assumption in res_pjsip_dtmf_info that all INFO messages will contain a body. X-Git-Tag: 13.0.0-beta1~1255 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17f332169c3e731e0ceec7166933b3c1b80edf68;p=thirdparty%2Fasterisk.git Remove assumption in res_pjsip_dtmf_info that all INFO messages will contain a body. (closes issue ASTERISK-22320) Reported by: Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396993 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_dtmf_info.c b/res/res_pjsip_dtmf_info.c index 6c69b53181..3cd410daee 100644 --- a/res/res_pjsip_dtmf_info.c +++ b/res/res_pjsip_dtmf_info.c @@ -39,14 +39,14 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj pjsip_tx_data *tdata; - char buf[body->len]; + char buf[body ? body->len : 0]; char *cur = buf; char *line; char event = '\0'; unsigned int duration = 0; - if (!ast_sip_is_content_type(&body->content_type, "application", "dtmf-relay")) { + if (!body || !ast_sip_is_content_type(&body->content_type, "application", "dtmf-relay")) { return 0; }