mirror of
https://github.com/nmap/nmap.git
synced 2025-12-08 21:51:28 +00:00
Fix off-by-one error in unicode.decode.
Would fail to decode the last character in a string.
This commit is contained in:
@@ -34,7 +34,7 @@ local unpack = bin.unpack
|
|||||||
function decode(buf, decoder, bigendian)
|
function decode(buf, decoder, bigendian)
|
||||||
local cp = {}
|
local cp = {}
|
||||||
local pos = 1
|
local pos = 1
|
||||||
while pos < #buf do
|
while pos <= #buf do
|
||||||
pos, cp[#cp+1] = decoder(buf, pos, bigendian)
|
pos, cp[#cp+1] = decoder(buf, pos, bigendian)
|
||||||
end
|
end
|
||||||
return cp
|
return cp
|
||||||
|
|||||||
Reference in New Issue
Block a user