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

Fix a bug: string.gsub, not string.sub

This commit is contained in:
dmiller
2019-08-02 04:21:39 +00:00
parent 13d70d9ac7
commit cbb759565f

View File

@@ -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)