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:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user