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

Joshua Colp asteriskteam at digium.com
Sat Mar 18 05:37:04 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5227 )

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(-)

Approvals:
  George Joseph: Looks good to me, approved
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified



diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 62fe4fd..e4e0d8e 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/5227
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9f7c09ce0b005efe362dbcc8795202b18f94611
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list