mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Use atoi to parse the argument to --max-os-tries, not tval2msecs. The
latter would allow you to do this: $ nmap --max-os-tries 1s localhost Bogus --max-os-tries argument specified, must be between 1 and 50 (inclusive) QUITTING! Because the "1s" became 1000. atoi isn't right for option parsing because it doesn't catch errors, but it's what the rest of the option parsing code uses.
This commit is contained in:
parent
dc03a70c79
commit
6940096a27
1 changed files with 1 additions and 1 deletions
2
nmap.cc
2
nmap.cc
|
|
@ -762,7 +762,7 @@ int nmap_main(int argc, char *argv[]) {
|
|||
} else
|
||||
#endif
|
||||
if (optcmp(long_options[option_index].name, "max-os-tries") == 0) {
|
||||
l = tval2msecs(optarg);
|
||||
l = atoi(optarg);
|
||||
if (l < 1 || l > 50)
|
||||
fatal("Bogus --max-os-tries argument specified, must be between 1 and 50 (inclusive)");
|
||||
o.setMaxOSTries(l);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue