diff options
author | Richard Mudgett <rmudgett@digium.com> | 2016-12-21 17:55:48 -0600 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-12-22 12:16:20 -0600 |
commit | bcdd282adaae7d47c91172d4e38306fc3b3566c7 (patch) | |
tree | 28eb041784837b0544c18ceddba0db8ab1602b0f | |
parent | ac31233dbe996b4e2a1ccf9b7b2b35f6ed19e43c (diff) |
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
-rw-r--r-- | res/res_rtp_asterisk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 1ae18fed3..054b0b658 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -4915,9 +4915,11 @@ static void ast_rtp_prop_set(struct ast_rtp_instance *instance, enum ast_rtp_pro 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); } |