1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Use keeppattern=true when using match.numbytes. Fixes #1855

This commit is contained in:
dmiller
2019-12-13 18:11:52 +00:00
parent ff61845ce2
commit a5a945347b
2 changed files with 3 additions and 3 deletions

View File

@@ -78,7 +78,7 @@ Response = {
local len = tonumber(data:match("^%$(%d*)")) local len = tonumber(data:match("^%$(%d*)"))
-- we should only have a single line, so we can just peel of the length -- we should only have a single line, so we can just peel of the length
status, data = self.socket:receive_buf(match.numbytes(len), false) status, data = self.socket:receive_buf(match.numbytes(len), true)
if( not(status) ) then if( not(status) ) then
return false, "Failed to receive data from server" return false, "Failed to receive data from server"
end end

View File

@@ -152,13 +152,13 @@ Helper = {
return false, data return false, data
end end
status, data = self.socket:receive_buf(match.numbytes(4), false) status, data = self.socket:receive_buf(match.numbytes(4), true)
if ( not(status) ) then if ( not(status) ) then
return false, data return false, data
end end
local len = string.unpack("<I2", data) local len = string.unpack("<I2", data)
status, data = self.socket:receive_buf(match.numbytes(len), false) status, data = self.socket:receive_buf(match.numbytes(len), true)
if ( not(status) ) then if ( not(status) ) then
return false, data return false, data
end end