From: Joshua Colp Date: Thu, 19 Jan 2012 21:12:20 +0000 (+0000) Subject: Prevent crash when an SDP offer is received with an encrypted video stream when suppo... X-Git-Tag: 10.2.0-rc1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f125c6200a00b9a1a497f515ee15f54bb52ec8fc;p=thirdparty%2Fasterisk.git Prevent crash when an SDP offer is received with an encrypted video stream when support for video is disabled and res_srtp is loaded. (closes issue ASTERISK-19202) Reported by: Catalin Sanda ........ Merged revisions 351504 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@351505 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 7608738c61..90c11076b9 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -30139,6 +30139,12 @@ static int setup_srtp(struct sip_srtp **srtp) static int process_crypto(struct sip_pvt *p, struct ast_rtp_instance *rtp, struct sip_srtp **srtp, const char *a) { + /* If no RTP instance exists for this media stream don't bother processing the crypto line */ + if (!rtp) { + ast_debug(3, "Received offer with crypto line for media stream that is not enabled\n"); + return FALSE; + } + if (strncasecmp(a, "crypto:", 7)) { return FALSE; }