From dc5d51f33507034c88aa17d8126aeef28780d0ab Mon Sep 17 00:00:00 2001 From: david Date: Thu, 29 Nov 2012 18:36:31 +0000 Subject: [PATCH] Fix copy-paste error in Ncat timeout warning messages. Patch by Michal Hlavinka. http://seclists.org/nmap-dev/2012/q4/351 --- CHANGELOG | 3 +++ ncat/ncat_main.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3065bee71..468ac3e61 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [Ncat] Fixed the printing of warning messages for large arguments to + the -i and -w options. [Michal Hlavinka] + o [NSE] Added CPE to smb-os-discovery output. o [Ncat] Shut down the write part of connected sockets in listen mode diff --git a/ncat/ncat_main.c b/ncat/ncat_main.c index 788de543d..511843db1 100644 --- a/ncat/ncat_main.c +++ b/ncat/ncat_main.c @@ -373,8 +373,8 @@ int main(int argc, char *argv[]) o.idletimeout = tval2msecs(optarg); if (o.idletimeout <= 0) bye("Invalid -i timeout (must be greater than 0)."); - if (o.linedelay >= 100 * 1000 && tval_unit(optarg) == NULL) - bye("Since April 2010, the default unit for -i is seconds, so your time of \"%s\" is %.1f minutes. Use \"%sms\" for %g milliseconds.", optarg, o.linedelay / 1000.0 / 60, optarg, o.linedelay / 1000.0); + if (o.idletimeout >= 100 * 1000 && tval_unit(optarg) == NULL) + bye("Since April 2010, the default unit for -i is seconds, so your time of \"%s\" is %.1f minutes. Use \"%sms\" for %g milliseconds.", optarg, o.idletimeout / 1000.0 / 60, optarg, o.idletimeout / 1000.0); break; case 's': source = optarg; @@ -399,8 +399,8 @@ int main(int argc, char *argv[]) o.conntimeout = tval2msecs(optarg); if (o.conntimeout <= 0) bye("Invalid -w timeout (must be greater than 0)."); - if (o.linedelay >= 100 * 1000 && tval_unit(optarg) == NULL) - bye("Since April 2010, the default unit for -w is seconds, so your time of \"%s\" is %.1f minutes. Use \"%sms\" for %g milliseconds.", optarg, o.linedelay / 1000.0 / 60, optarg, o.linedelay / 1000.0); + if (o.conntimeout >= 100 * 1000 && tval_unit(optarg) == NULL) + bye("Since April 2010, the default unit for -w is seconds, so your time of \"%s\" is %.1f minutes. Use \"%sms\" for %g milliseconds.", optarg, o.conntimeout / 1000.0 / 60, optarg, o.conntimeout / 1000.0); break; case 't': o.telnet = 1;