[asterisk-commits] file: branch 12 r400360 - /branches/12/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 3 09:51:45 CDT 2013


Author: file
Date: Thu Oct  3 09:51:41 2013
New Revision: 400360

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400360
Log:
Fix crashes in res_pjsip_sdp_rtp and res_pjsip_t38 when a stream is rejected and external_media_address is set.

The callback function for changing the media address in streams wrongly assumes that a connection line
will always be present. This is false as no line is present if a stream has been rejected.

(closes issue ASTERISK-22645)
Reported by: Rusty Newton

Modified:
    branches/12/res/res_pjsip_sdp_rtp.c
    branches/12/res/res_pjsip_t38.c

Modified: branches/12/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_sdp_rtp.c?view=diff&rev=400360&r1=400359&r2=400360
==============================================================================
--- branches/12/res/res_pjsip_sdp_rtp.c (original)
+++ branches/12/res/res_pjsip_sdp_rtp.c Thu Oct  3 09:51:41 2013
@@ -1097,6 +1097,11 @@
 	char host[NI_MAXHOST];
 	struct ast_sockaddr addr = { { 0, } };
 
+	/* If the stream has been rejected there will be no connection line */
+	if (!stream->conn) {
+		return;
+	}
+
 	ast_copy_pj_str(host, &stream->conn->addr, sizeof(host));
 	ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
 

Modified: branches/12/res/res_pjsip_t38.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_t38.c?view=diff&rev=400360&r1=400359&r2=400360
==============================================================================
--- branches/12/res/res_pjsip_t38.c (original)
+++ branches/12/res/res_pjsip_t38.c Thu Oct  3 09:51:41 2013
@@ -776,6 +776,11 @@
 	char host[NI_MAXHOST];
 	struct ast_sockaddr addr = { { 0, } };
 
+	/* If the stream has been rejected there will be no connection line */
+	if (!stream->conn) {
+		return;
+	}
+
 	ast_copy_pj_str(host, &stream->conn->addr, sizeof(host));
 	ast_sockaddr_parse(&addr, host, PARSE_PORT_FORBID);
 




More information about the asterisk-commits mailing list