[Asterisk-code-review] res rtp asterisk: Fix crash when RTCP is not present when DT... (asterisk[master])

Joshua Colp asteriskteam at digium.com
Thu Mar 16 10:47:37 CDT 2017


Joshua Colp has uploaded a new change for review. ( https://gerrit.asterisk.org/5232 )

Change subject: res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is stopped.
......................................................................

res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is stopped.

This change removes an assumption that when DTLS is stopped
an RTCP session will be present on the RTP session. This is not
always the case.

ASTERISK-26732

Change-Id: Ib9f7c09ce0b005efe362dbcc8795202b18f94611
---
M res/res_rtp_asterisk.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/32/5232/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index a67bc81..ca61470 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1577,7 +1577,7 @@
 static void ast_rtp_dtls_stop(struct ast_rtp_instance *instance)
 {
 	struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
-	int rtcp_dtls_unique = (rtp->dtls.ssl != rtp->rtcp->dtls.ssl);
+	SSL *ssl = rtp->dtls.ssl;
 
 	dtls_srtp_stop_timeout_timer(instance, rtp, 0);
 
@@ -1595,7 +1595,7 @@
 	if (rtp->rtcp) {
 		dtls_srtp_stop_timeout_timer(instance, rtp, 1);
 
-		if (rtp->rtcp->dtls.ssl && rtcp_dtls_unique) {
+		if (rtp->rtcp->dtls.ssl && (rtp->rtcp->dtls.ssl != ssl)) {
 			SSL_free(rtp->rtcp->dtls.ssl);
 			rtp->rtcp->dtls.ssl = NULL;
 			ast_mutex_destroy(&rtp->rtcp->dtls.lock);

-- 
To view, visit https://gerrit.asterisk.org/5232
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9f7c09ce0b005efe362dbcc8795202b18f94611
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list