1
0
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:
jah
2013-11-26 00:11:09 +00:00
parent c47c0e2567
commit d0a95fe03e

View File

@@ -2038,6 +2038,10 @@ int determineScanGroupSize(int hosts_scanned_so_far,
groupsize = box(o.minHostGroupSz(), o.maxHostGroupSz(), groupsize); 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; return groupsize;
} }