1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-27 01:49:03 +00:00

Don't crash a thread if Driver.connect didn't return a brute.Error

This commit is contained in:
dmiller
2018-03-10 03:09:33 +00:00
parent 822dfa51a0
commit 918c24a540

View File

@@ -703,14 +703,22 @@ Engine = {
-- Temporary workaround. Did not connect sucessfully
-- due to stressed server
if not status and response:isReduce() then
if not status then
-- We have to first check whether the response is a brute.Error
-- since many times the connect method returns a string error instead,
-- which could crash this thread in several places
if response and not response.isReduce then
-- Create a new Error
response = Error:new("Connect error: " .. response)
response:setRetry(true)
end
if response:isReduce() then
local ret_creds = {}
ret_creds.connect_phase = true
return false, response, ret_creds
end
end
else
-- Did we successfully connect?
if status then
if not username and not password then
repeat
if #self.retry_accounts > 0 then