Skip to content

Commit

Permalink
dns: Fix server_idx overflow to DNS_MAX_SERVERS triggering LWIP_ASSERT
Browse files Browse the repository at this point in the history
9247429 dns: Fix server_idx increasing to DNS_MAX_SERVERS and trigger the LWIP_ASSERT
  • Loading branch information
ESP-YJM authored and david-cermak committed Sep 10, 2024
1 parent c97293f commit 5861ff0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,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 */
Expand Down

0 comments on commit 5861ff0

Please sign in to comment.