[Asterisk-code-review] res pjsip: Don't assume a request will have any addresses. (asterisk[14])
Joshua Colp
asteriskteam at digium.com
Tue Sep 13 06:09:57 CDT 2016
Joshua Colp has uploaded a new change for review.
https://gerrit.asterisk.org/3888
Change subject: res_pjsip: Don't assume a request will have any addresses.
......................................................................
res_pjsip: Don't assume a request will have any addresses.
When performing DNS resolution the failover code present in
res_pjsip currently assumes that a request will always have
at least one viable address. In practice this is not true.
A domain may be used that has no records.
The code now checks that at least one address exists on the
request which prevents looping.
ASTERISK-26364 #close
Change-Id: Ic0761b0264864acd85915c94d878a81624940f4c
---
M res/res_pjsip.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/88/3888/1
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 34edc8c..8ecdb03 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3578,7 +3578,7 @@
{
pjsip_via_hdr *via;
- if (tdata->dest_info.cur_addr == tdata->dest_info.addr.count - 1) {
+ if (!tdata->dest_info.addr.count || (tdata->dest_info.cur_addr == tdata->dest_info.addr.count - 1)) {
/* No more addresses to try */
return 0;
}
--
To view, visit https://gerrit.asterisk.org/3888
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0761b0264864acd85915c94d878a81624940f4c
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
More information about the asterisk-code-review
mailing list