]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Prevent crash when an SDP offer is received with an encrypted video stream when suppo...
authorJoshua Colp <jcolp@digium.com>
Thu, 19 Jan 2012 21:11:12 +0000 (21:11 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 19 Jan 2012 21:11:12 +0000 (21:11 +0000)
(closes issue ASTERISK-19202)
Reported by: Catalin Sanda

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@351504 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 06886e6d20236937cf527546dfe3c59c1667ad36..9f5e94a5a6ff2b0755832d5dddf484f38a002f81 100644 (file)
@@ -29394,6 +29394,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;
        }