1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-30 11:29:01 +00:00

Prevent an error when optional argument "overrides" is not passed

Prevent a potentially unexpected side-effect when the argument is passed.
This commit is contained in:
nnposter
2019-09-05 21:56:54 +00:00
parent 90a2063c9d
commit 59c53f07fd
2 changed files with 5 additions and 3 deletions

View File

@@ -133,6 +133,7 @@ local smbauth = require "smbauth"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
local tableaux = require "tableaux"
local unicode = require "unicode"
local smb2 = require "smb2"
_ENV = stdnse.module("smb", stdnse.seeall)
@@ -1093,6 +1094,8 @@ function list_dialects(host, overrides)
local status, smb1_dialect
local smbstate
overrides = tableaux.tcopy(overrides or {})
-- Check for SMBv1 first
stdnse.debug2("Checking if SMBv1 is supported")
status, smbstate = start(host)

View File

@@ -51,10 +51,9 @@ hostrule = function(host)
end
action = function(host,port)
local status, supported_dialects, overrides
local status, supported_dialects
local output = stdnse.output_table()
overrides = {}
status, supported_dialects = smb.list_dialects(host, overrides)
status, supported_dialects = smb.list_dialects(host)
if status then
for i, v in pairs(supported_dialects) do -- Mark SMBv1 as insecure
if v == "NT LM 0.12" then