summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-09-13 07:08:18 -0400
committerJoshua Colp <jcolp@digium.com>2016-09-13 06:10:06 -0500
commite3487b9360bc48c9bf777bef18f19f8a8fcc7a62 (patch)
tree6dedd3237ee794f006bab7aa48e19fde3f29c5e5 /res
parent7d7b23f04f2d45a531afd8fd8d0a172ab8411932 (diff)
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
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 7bb10c07f..8a9322258 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3584,7 +3584,7 @@ int ast_sip_failover_request(pjsip_tx_data *tdata)
{
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;
}