[asterisk-commits] res rtp asterisk.c: Initialize ourip passed to ast find ouri... (asterisk[certified/13.13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 6 13:16:08 CST 2017


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4668 )

Change subject: res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip().
......................................................................


res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip().

We access uninitialized memory when the 'ourip' parameter does not
have an initial guess to our IP address.

ASTERISK-26672

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

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 75bace2..d271e72 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -4881,9 +4881,11 @@
 			ast_sockaddr_set_port(&rtp->rtcp->us,
 					      ast_sockaddr_port(&rtp->rtcp->us) + 1);
 
+			ast_sockaddr_copy(&local_addr, &rtp->rtcp->us);
 			if (!ast_find_ourip(&local_addr, &rtp->rtcp->us, 0)) {
 				ast_sockaddr_set_port(&local_addr, ast_sockaddr_port(&rtp->rtcp->us));
 			} else {
+				/* Failed to get local address reset to use default. */
 				ast_sockaddr_copy(&local_addr, &rtp->rtcp->us);
 			}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I35507ea1ad7455d2be188f6ccdd4add7bd150e15
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list