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:25:15 -0600 |
commit | 2fc65173e56910f72ca9a432290f49dd7a3aa82e (patch) | |
tree | cb7f2b629c57c128195be978adfee4204413d4d4 | |
parent | 67cc8499a27a31a02bea3a370ebcc1afd1cb3f98 (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 b78fc30bd..1721811ee 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -4912,9 +4912,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); } |