1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 12:19:02 +00:00

Fix NSE hangs when service sends non-matching data to receive_buf

This commit is contained in:
dmiller
2017-03-29 20:41:59 +00:00
parent 85e10c6b2b
commit 3dec043ead
26 changed files with 92 additions and 39 deletions

View File

@@ -39,7 +39,7 @@ Helper = {
if ( not(status) ) then
return false, err
end
local status, data = self.socket:receive_buf("\n", false)
local status, data = self.socket:receive_buf(match.pattern_limit("\n", 2048), false)
if( not(status) ) then
return false, err
end
@@ -119,7 +119,7 @@ Helper = {
local modules = {}
while(true) do
status, data = self.socket:receive_buf("\n", false)
status, data = self.socket:receive_buf(match.pattern_limit("\n", 2048), false)
if (not(status)) then
return false, data
end