1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Fixed an integer overflow in the dns caching code that caused nmap to loop infinitely once it had expunging the cache of older entries.

This commit is contained in:
ejlbell
2008-01-14 15:16:50 +00:00
parent 77445b81b1
commit 9bc09ef2cc

View File

@@ -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;
}
}
}