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

Finish applying patch from #1158

This commit is contained in:
dmiller
2018-04-10 03:18:50 +00:00
parent 99e69ecae5
commit 87794c45ce
2 changed files with 7 additions and 4 deletions

View File

@@ -1,5 +1,7 @@
#Nmap Changelog ($Id$); -*-text-*- #Nmap Changelog ($Id$); -*-text-*-
o [NSE][GH#1158] Fix parsing http-grep.match script-arg. [Hans van den Bogert]
o [Zenmap][GH#1177] Avoid a crash when recent_scans.txt cannot be written to. o [Zenmap][GH#1177] Avoid a crash when recent_scans.txt cannot be written to.
[Daniel Miller] [Daniel Miller]

View File

@@ -231,7 +231,7 @@ action = function(host, port)
local results = stdnse.output_table() local results = stdnse.output_table()
local all_match = {} -- a table that stores all matches. used to eliminate duplicates. local all_match = {} -- a table that stores all matches. used to eliminate duplicates.
-- check if builtin arugment is a table or a single value -- check if builtin argument is a table or a single value
if builtins and builtins == 1 then if builtins and builtins == 1 then
for name, patterns in pairs(BUILT_IN_PATTERNS) do for name, patterns in pairs(BUILT_IN_PATTERNS) do
to_be_searched[name] = {} to_be_searched[name] = {}
@@ -257,14 +257,15 @@ action = function(host, port)
end end
end end
-- check if match arugment is a table or a single value -- check if match argument is a table or a single value
if match and type(match) ~= 'table' then if match and type(match) ~= 'table' then
to_be_searched['User Pattern 1'] = {} to_be_searched['User Pattern 1'] = {}
table.insert(to_be_searched['User Pattern 1'], match) table.insert(to_be_searched['User Pattern 1'], match)
elseif type(match) == 'table' then elseif type(match) == 'table' then
for i, pattern in pairs(match) do for i, pattern in pairs(match) do
to_be_searched['User Pattern ' .. tostring(i)] = {} local k = 'User Pattern ' .. tostring(i)
table.insert(to_be_searched['User Pattern ' .. tostring(i)], pattern) to_be_searched[k] = {}
table.insert(to_be_searched[k], pattern)
end end
end end