mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 05:09:00 +00:00
Fix assertion error when stats requested and 0 threads scheduled
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
# Nmap Changelog ($Id$); -*-text-*-
|
# Nmap Changelog ($Id$); -*-text-*-
|
||||||
|
|
||||||
|
o [NSE] Fix a crash that happened when trying to print the percent done of 0
|
||||||
|
NSE script threads:
|
||||||
|
timing.cc:710 bool ScanProgressMeter::printStats(double, const timeval*): Assertion 'ltime' failed.
|
||||||
|
This would happen if no scripts were scheduled in a scan phase and the user
|
||||||
|
pressed a key or specified a short --stats-every interval. Reported by
|
||||||
|
Richard Petrie. [Daniel Miller]
|
||||||
|
|
||||||
o [NSE] ssl-enum-ciphers will give a failing score to any server with an RSA
|
o [NSE] ssl-enum-ciphers will give a failing score to any server with an RSA
|
||||||
certificate whose public key uses an exponent of 1. [Daniel Miller]
|
certificate whose public key uses an exponent of 1. [Daniel Miller]
|
||||||
|
|
||||||
|
|||||||
@@ -958,7 +958,8 @@ local function run (threads_iter, hosts)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local nr, nw = table_size(running), table_size(waiting);
|
local nr, nw = table_size(running), table_size(waiting);
|
||||||
if cnse.key_was_pressed() then
|
-- total may be 0 if no scripts are running in this phase
|
||||||
|
if total > 0 and cnse.key_was_pressed() then
|
||||||
print_verbose(1, "Active NSE Script Threads: %d (%d waiting)",
|
print_verbose(1, "Active NSE Script Threads: %d (%d waiting)",
|
||||||
nr+nw, nw);
|
nr+nw, nw);
|
||||||
progress("printStats", 1-(nr+nw)/total);
|
progress("printStats", 1-(nr+nw)/total);
|
||||||
@@ -972,7 +973,7 @@ local function run (threads_iter, hosts)
|
|||||||
(gsub(traceback(co), "\n", "\n\t")));
|
(gsub(traceback(co), "\n", "\n\t")));
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif progress "mayBePrinted" then
|
elseif total > 0 and progress "mayBePrinted" then
|
||||||
if verbosity() > 1 or debugging() > 0 then
|
if verbosity() > 1 or debugging() > 0 then
|
||||||
progress("printStats", 1-(nr+nw)/total);
|
progress("printStats", 1-(nr+nw)/total);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user