1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Avoid masked use of date before 1/1/1970 UTC. Fixes #2136, closes #2137

This commit is contained in:
nnposter
2020-10-04 03:28:01 +00:00
parent 1a87f11f42
commit 63c88b1a74
2 changed files with 6 additions and 1 deletions

View File

@@ -1,5 +1,8 @@
#Nmap Changelog ($Id$); -*-text-*-
o [NSE][GH#2136][GH#2137] Rectify error "time result cannot be represented..."
in the FP library. [Clément Notin, nnposter]
o [NSE] Script mysql-audit now defaults to the bundled mysql-cis.audit for
the audit rule base. [nnposter]

View File

@@ -350,7 +350,9 @@ local ERROR_MSG = {
[ERROR.FPCallNotSupported] = "Server does not support this command.",
}
local TIME_OFFSET = os.time{year=2000, month=1, day=1, hour=0} - os.time{year=1970, month=1, day=1, hour=0}
-- Dates are shifted forward one day to avoid referencing 12/31/1969 UTC
-- when specifying 1/1/1970 (local) in a timezone that is ahead of UTC
local TIME_OFFSET = os.time({year=2000, month=1, day=2, hour=0}) - os.time({year=1970, month=1, day=2, hour=0})
-- Check if all the bits in flag are set in bitmap.
local function flag_is_set(bitmap, flag)