mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -3584,7 +3584,7 @@ int ast_sip_failover_request(pjsip_tx_data *tdata)
|
|||||||
{
|
{
|
||||||
pjsip_via_hdr *via;
|
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 */
|
/* No more addresses to try */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user