1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 10:29:03 +00:00

Don't crash on stdnse.parse_timespec(nil)

This commit is contained in:
dmiller
2013-03-06 04:36:09 +00:00
parent 9cfdb23f75
commit ab098ef4d2

View File

@@ -341,6 +341,7 @@ end
-- @return A number of seconds, or <code>nil</code> followed by an error
-- message.
function parse_timespec(timespec)
if timespec == nil then return nil, "Can't parse nil timespec" end
local n, unit, t, m
local multipliers = {[""] = 1, s = 1, m = 60, h = 60 * 60, ms = 0.001}