diff --git a/CHANGELOG b/CHANGELOG index a1813ee83..e05b895fc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,12 @@ # 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 certificate whose public key uses an exponent of 1. [Daniel Miller] diff --git a/nse_main.lua b/nse_main.lua index f7d8b69ed..7dff8982d 100644 --- a/nse_main.lua +++ b/nse_main.lua @@ -958,7 +958,8 @@ local function run (threads_iter, hosts) end 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)", nr+nw, nw); progress("printStats", 1-(nr+nw)/total); @@ -972,7 +973,7 @@ local function run (threads_iter, hosts) (gsub(traceback(co), "\n", "\n\t"))); end end - elseif progress "mayBePrinted" then + elseif total > 0 and progress "mayBePrinted" then if verbosity() > 1 or debugging() > 0 then progress("printStats", 1-(nr+nw)/total); else