mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Corrects handling of empty pipelines, expressed as nil. Fixes #538
This commit is contained in:
@@ -1811,7 +1811,6 @@ end
|
|||||||
-- @return A list of responses, in the same order as the requests were queued.
|
-- @return A list of responses, in the same order as the requests were queued.
|
||||||
-- Each response is a table as described in the module documentation.
|
-- Each response is a table as described in the module documentation.
|
||||||
function pipeline_go(host, port, all_requests)
|
function pipeline_go(host, port, all_requests)
|
||||||
stdnse.debug1("Total number of pipelined requests: " .. #all_requests)
|
|
||||||
local responses
|
local responses
|
||||||
local response
|
local response
|
||||||
local partial
|
local partial
|
||||||
@@ -1819,10 +1818,11 @@ function pipeline_go(host, port, all_requests)
|
|||||||
responses = {}
|
responses = {}
|
||||||
|
|
||||||
-- Check for an empty request
|
-- Check for an empty request
|
||||||
if (#all_requests == 0) then
|
if (not all_requests or #all_requests == 0) then
|
||||||
stdnse.debug1("Warning: empty set of requests passed to http.pipeline_go()")
|
stdnse.debug1("Warning: empty set of requests passed to http.pipeline_go()")
|
||||||
return responses
|
return responses
|
||||||
end
|
end
|
||||||
|
stdnse.debug1("Total number of pipelined requests: " .. #all_requests)
|
||||||
|
|
||||||
local socket, bopt
|
local socket, bopt
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user