1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 05:01:29 +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:
dmiller
2014-02-19 18:32:21 +00:00
parent 44a006a7cf
commit a76990b9ae

View File

@@ -34,7 +34,7 @@ local unpack = bin.unpack
function decode(buf, decoder, bigendian)
local cp = {}
local pos = 1
while pos < #buf do
while pos <= #buf do
pos, cp[#cp+1] = decoder(buf, pos, bigendian)
end
return cp