[asterisk-commits] file: branch group/pimp_my_sip r392563 - /team/group/pimp_my_sip/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jun 22 08:47:08 CDT 2013


Author: file
Date: Sat Jun 22 08:47:05 2013
New Revision: 392563

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392563
Log:
Fix a crash when SRTP is not present.

Modified:
    team/group/pimp_my_sip/channels/chan_sip.c

Modified: team/group/pimp_my_sip/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/channels/chan_sip.c?view=diff&rev=392563&r1=392562&r2=392563
==============================================================================
--- team/group/pimp_my_sip/channels/chan_sip.c (original)
+++ team/group/pimp_my_sip/channels/chan_sip.c Sat Jun 22 08:47:05 2013
@@ -12994,7 +12994,13 @@
 static char *crypto_get_attrib(struct ast_sdp_srtp *srtp, int dtls_enabled, int default_taglen_32)
 {
 	char *a_crypto;
-	char *orig_crypto = ast_strdupa(ast_sdp_srtp_get_attrib(srtp, dtls_enabled, default_taglen_32));
+	char *orig_crypto;
+
+	if (!srtp) {
+		return NULL;
+	}
+
+	orig_crypto = ast_strdupa(ast_sdp_srtp_get_attrib(srtp, dtls_enabled, default_taglen_32));
 	if (ast_asprintf(&a_crypto, "a=crypto:%s\r\n", orig_crypto) == -1) {
 		return NULL;
 	}




More information about the asterisk-commits mailing list