diff --git a/nmap_dns.cc b/nmap_dns.cc index 714ad1314..6984e118f 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -1041,7 +1041,8 @@ static void addto_etchosts(u32 ip, const char *hname) { for(i = 0; i < HASH_TABLE_SIZE; i++) { while((it = find_if(etchosts[i].begin(), etchosts[i].end(), remove_and_age)) != etchosts[i].end()) { etchosts[i].erase(it); - total_size--; + if((total_size--) < HASH_TABLE_SIZE/2) + break; } } }