From a5a945347b4dda9320b0305ec05d77b3b731fecb Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 13 Dec 2019 18:11:52 +0000 Subject: [PATCH] Use keeppattern=true when using match.numbytes. Fixes #1855 --- nselib/redis.lua | 2 +- nselib/rsync.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nselib/redis.lua b/nselib/redis.lua index 50b28b850..fab919059 100644 --- a/nselib/redis.lua +++ b/nselib/redis.lua @@ -78,7 +78,7 @@ Response = { local len = tonumber(data:match("^%$(%d*)")) -- 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 return false, "Failed to receive data from server" end diff --git a/nselib/rsync.lua b/nselib/rsync.lua index cc6fa19b0..f477524d1 100644 --- a/nselib/rsync.lua +++ b/nselib/rsync.lua @@ -152,13 +152,13 @@ Helper = { return false, data 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 return false, data end local len = string.unpack("