diff --git a/CHANGELOG b/CHANGELOG index 39d9d81ca..9293f52cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ #Nmap Changelog ($Id$); -*-text-*- +o Nmap will now allow targets to be specified both on the command line and in + an input file with -iL. Previously, if targets were provided in both places, + only the targets in the input file would be scanned, and no notice was given + that the command-line targets were ignored. [Daniel Miller] + o [GH#1451] Nmap now performs forward DNS lookups in parallel, using the same engine that has been reliably performing reverse-DNS lookups for nearly a decade. Scanning large lists of hostnames is now enormously faster and avoids diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index da8d6bdfc..947f12d0e 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -4678,16 +4678,17 @@ const char *grab_next_host_spec(FILE *inputfd, int argc, const char **argv) { static char host_spec[1024]; size_t n; - if (!inputfd) { - return( (optind < argc)? argv[optind++] : NULL); - } else { + if (optind < argc) { + return argv[optind++]; + } else if (inputfd) { n = read_host_from_file(inputfd, host_spec, sizeof(host_spec)); if (n == 0) return NULL; else if (n >= sizeof(host_spec)) netutil_fatal("One of the host specifications from your input file is too long (>= %u chars)", (unsigned int) sizeof(host_spec)); + return host_spec; } - return host_spec; + return NULL; }