1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-30 19:39:07 +00:00

Use dns.decStr in dns-zone-transfer.nse instead of a custom DNS decoder. This

avoids an infinite recursion bug present in the old decoder. I raised the
number of compression pointers that dns.decStr will follow from 1 to 3 because
I found a server that sent 2.
This commit is contained in:
david
2009-02-10 00:53:26 +00:00
parent b83d8141bf
commit 2d018963ca
2 changed files with 11 additions and 41 deletions

View File

@@ -479,14 +479,14 @@ end
-- @param pos Starting position in packet.
-- @return Position after decoding.
-- @return Decoded domain, or <code>nil</code> on error.
local function decStr(data, pos)
function decStr(data, pos)
local function dec(data, pos, limit)
local partlen
local parts = {}
local part
-- Avoid infinite recursion on malformed compressed messages.
limit = limit or 1
limit = limit or 3
if limit < 0 then
return pos, nil
end