1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-09 06:56:35 +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:
david
2010-04-15 22:42:13 +00:00
parent dc03a70c79
commit 6940096a27

View File

@@ -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);