From 47ee5c2923ad63f3097f0517aad6a9e2b783088d Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 3 Jul 2025 17:32:45 +0000 Subject: [PATCH] Fix bug in parallel DNS: out-of-bounds read in timeouts --- nmap_dns.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nmap_dns.cc b/nmap_dns.cc index 59778ded7..77e7419ae 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -601,6 +601,8 @@ static int deal_with_timedout_reads(bool adjust_timing) { else { may_increase = false; tpreq->tries++; + if (tpreq->tries > MAX_DNS_TRIES) + tpreq->tries = MAX_DNS_TRIES; servI->in_process.erase(reqI); records.erase(tpreq->id); servI->reqs_on_wire--;