mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +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:
@@ -1041,7 +1041,8 @@ static void addto_etchosts(u32 ip, const char *hname) {
|
|||||||
for(i = 0; i < HASH_TABLE_SIZE; i++) {
|
for(i = 0; i < HASH_TABLE_SIZE; i++) {
|
||||||
while((it = find_if(etchosts[i].begin(), etchosts[i].end(), remove_and_age)) != etchosts[i].end()) {
|
while((it = find_if(etchosts[i].begin(), etchosts[i].end(), remove_and_age)) != etchosts[i].end()) {
|
||||||
etchosts[i].erase(it);
|
etchosts[i].erase(it);
|
||||||
total_size--;
|
if((total_size--) < HASH_TABLE_SIZE/2)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user