mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 17:09:02 +00:00
Move length checks to before string.unpack to avoid throwing errors
This commit is contained in:
@@ -179,10 +179,10 @@ end
|
||||
local function decodeSeq(encStr, len, pos)
|
||||
local seq = {}
|
||||
local sPos = 1
|
||||
local sStr, newpos = string.unpack("c" .. len, encStr, pos)
|
||||
if(sStr==nil) then
|
||||
return seq, newpos
|
||||
if #encStr - pos + 1 < len then
|
||||
return seq, nil
|
||||
end
|
||||
local sStr, newpos = string.unpack("c" .. len, encStr, pos)
|
||||
while (sPos < len) do
|
||||
local newSeq
|
||||
newSeq, sPos = decode(sStr, sPos)
|
||||
|
||||
Reference in New Issue
Block a user