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

Don't scan infinite random when no targets specified

This commit is contained in:
dmiller
2024-06-05 16:09:58 +00:00
parent c6ffdbf7ae
commit a908872dae
3 changed files with 4 additions and 4 deletions

View File

@@ -285,7 +285,7 @@ bool target_needs_new_hostgroup(Target **targets, int targets_sz, const Target *
The target_expressions array MUST REMAIN VALID IN MEMORY as long as
this class instance is used -- the array is NOT copied.
*/
HostGroupState::HostGroupState(int lookahead, int rnd, unsigned long num_random, int argc, const char **argv) {
HostGroupState::HostGroupState(int lookahead, int rnd, bool gen_rand, unsigned long num_random, int argc, const char **argv) {
assert(lookahead > 0);
this->argc = argc;
this->argv = argv;
@@ -296,7 +296,7 @@ HostGroupState::HostGroupState(int lookahead, int rnd, unsigned long num_random,
current_batch_sz = 0;
next_batch_no = 0;
randomize = rnd;
if (num_random >= 0) {
if (gen_rand) {
current_group.generate_random_ips(num_random);
}
}