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

Richard Mudgett asteriskteam at digium.com
Thu Dec 22 12:28:27 CST 2016


Richard Mudgett has uploaded a new change for review. ( 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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/68/4668/1

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: newchange
Gerrit-Change-Id: I35507ea1ad7455d2be188f6ccdd4add7bd150e15
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list