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

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


Richard Mudgett has uploaded a new change for review. ( https://gerrit.asterisk.org/4656 )

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/56/4656/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 1ae18fe..054b0b6 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -4915,9 +4915,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/4656
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35507ea1ad7455d2be188f6ccdd4add7bd150e15
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list