diff --git a/CHANGELOG b/CHANGELOG index 4765326fe..3fdac062c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o When provided a verbosity of 0 (-v0), Nmap will not output any text to the + screen. This happens at the time of argument parsing, so the usual meaning of + "verbosity 0" is preserved. [isjing] + o [Nsock] Avoid a crash on Windows and other systems which use nbase's vasprintf implementation. In the case of unknown OpenSSL errors, ERR_reason_error_string would return NULL, which could not be printed with diff --git a/nmap.cc b/nmap.cc index cd9f8aa1f..b37c07ca4 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1422,6 +1422,11 @@ void parse_options(int argc, char **argv) { case 'v': if (optarg && isdigit(optarg[0])) { o.verbose = atoi(optarg); + if (o.verbose == 0) { + o.nmap_stdout = fopen(DEVNULL, "w"); + if (!o.nmap_stdout) + fatal("Could not assign %s to stdout for writing", DEVNULL); + } } else { const char *p; o.verbose++;