From cbb759565f3a0574d7eb4624b811b6c02a97e539 Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 2 Aug 2019 04:21:39 +0000 Subject: [PATCH] Fix a bug: string.gsub, not string.sub --- scripts/p2p-conficker.nse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/p2p-conficker.nse b/scripts/p2p-conficker.nse index aa4d24e04..4e457832e 100644 --- a/scripts/p2p-conficker.nse +++ b/scripts/p2p-conficker.nse @@ -273,7 +273,7 @@ local function p2p_checksum(data) stdnse.debug2("Conficker: Calculating checksum for %d-byte buffer", #data) - data:sub(".", function(i) + data:gsub(".", function(i) local h = hash ~ string.byte(i) -- Incorporate the current character into the checksum hash = (h + h) | (h >> 31)