diff options
author | Joshua Colp <jcolp@digium.com> | 2012-01-19 21:13:02 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2012-01-19 21:13:02 +0000 |
commit | ddf421bd5c45b94ac31c34c6699f21cf067ab3d1 (patch) | |
tree | 60bdcc2fb117e86bb5bf841ab3f1f19d3613765e | |
parent | 16adf6de8c4e3bf7dbfb1960b7ba2e4e5400d1b2 (diff) |
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
........
Merged revisions 351505 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c9ca7d85d..abf535782 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -30275,6 +30275,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; } |