diff --git a/nselib/dns.lua b/nselib/dns.lua index d404695da..36e71794c 100644 --- a/nselib/dns.lua +++ b/nselib/dns.lua @@ -486,7 +486,7 @@ function decStr(data, pos) local part -- Avoid infinite recursion on malformed compressed messages. - limit = limit or 3 + limit = limit or 10 if limit < 0 then return pos, nil end diff --git a/scripts/dns-zone-transfer.nse b/scripts/dns-zone-transfer.nse index 8557d44d0..5a798e1f3 100644 --- a/scripts/dns-zone-transfer.nse +++ b/scripts/dns-zone-transfer.nse @@ -123,7 +123,9 @@ end --@param data String of data. --@param offset Offset in the string to read the domain name. function parse_domain(data, offset) - return dns.decStr(data, offset) + local offset, domain = dns.decStr(data, offset) + domain = domain or "" + return offset, domain end --- Build RFC 1035 root domain name from the name of the DNS server