mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
determineScanGroupSize could cause a higher number of randomly generated hosts
to be scanned than was requested with -iR N (for 0 < N < 16) because it didn't account for max_ips_to_scan.
This commit is contained in:
@@ -2038,6 +2038,10 @@ int determineScanGroupSize(int hosts_scanned_so_far,
|
||||
|
||||
groupsize = box(o.minHostGroupSz(), o.maxHostGroupSz(), groupsize);
|
||||
|
||||
if (o.max_ips_to_scan && (o.max_ips_to_scan - hosts_scanned_so_far) < groupsize)
|
||||
// don't scan more randomly generated hosts than was specified
|
||||
groupsize = o.max_ips_to_scan - hosts_scanned_so_far;
|
||||
|
||||
return groupsize;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user