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:
@@ -273,7 +273,7 @@ local function p2p_checksum(data)
|
|||||||
|
|
||||||
stdnse.debug2("Conficker: Calculating checksum for %d-byte buffer", #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)
|
local h = hash ~ string.byte(i)
|
||||||
-- Incorporate the current character into the checksum
|
-- Incorporate the current character into the checksum
|
||||||
hash = (h + h) | (h >> 31)
|
hash = (h + h) | (h >> 31)
|
||||||
|
|||||||
Reference in New Issue
Block a user