dns: Fix server_idx increasing to DNS_MAX_SERVERS and trigger the LWIP_ASSERT

Closes https://github.com/espressif/esp-idf/issues/6878
This commit is contained in:
yuanjm
2021-04-22 14:47:18 +08:00
parent 2c9c531f0a
commit 5a567d52f7

View File

@ -1089,8 +1089,8 @@ dns_check_entry(u8_t i)
entry->tmr = 1;
entry->retries = 0;
#if ESP_DNS
while((entry->server_idx < DNS_MAX_SERVERS) && ip_addr_isany_val(dns_servers[entry->server_idx])) {
entry->server_idx++;
while((entry->server_idx + 1 < DNS_MAX_SERVERS) && ip_addr_isany_val(dns_servers[entry->server_idx])) {
entry->server_idx ++;
}
#endif
/* send DNS packet for this entry */