mirror of
https://github.com/nmap/nmap.git
synced 2026-10-21 03:11:48 +00:00
Adds protection against dealing with excessive timer values.
As a side effect it silences current MSVC compiler warning about "possible loss of data". See #995
This commit is contained in:
parent
8f54ffa15d
commit
9d11605113
1 changed files with 5 additions and 5 deletions
10
nmap.cc
10
nmap.cc
|
|
@ -748,10 +748,10 @@ void parse_options(int argc, char **argv) {
|
|||
o.scripthelp = true;
|
||||
o.chooseScripts(optarg);
|
||||
} else if (optcmp(long_options[option_index].name, "script-timeout") == 0) {
|
||||
l = tval2secs(optarg);
|
||||
if ( l < 0 )
|
||||
d = tval2secs(optarg);
|
||||
if (d < 0 || d > LONG_MAX)
|
||||
fatal("Bogus --script-timeout argument specified");
|
||||
delayed_options.pre_scripttimeout = l;
|
||||
delayed_options.pre_scripttimeout = d;
|
||||
} else
|
||||
#endif
|
||||
if (optcmp(long_options[option_index].name, "max-os-tries") == 0) {
|
||||
|
|
@ -1053,8 +1053,8 @@ void parse_options(int argc, char **argv) {
|
|||
o.adler32 = true;
|
||||
} else if (optcmp(long_options[option_index].name, "stats-every") == 0) {
|
||||
d = tval2secs(optarg);
|
||||
if (d < 0)
|
||||
fatal("Argument to --stats-every cannot be negative.");
|
||||
if (d < 0 || d > LONG_MAX)
|
||||
fatal("Bogus --stats-every argument specified");
|
||||
o.stats_interval = d;
|
||||
} else if (optcmp(long_options[option_index].name, "disable-arp-ping") == 0) {
|
||||
o.implicitARPPing = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue