util.dns: Fix returning read position after zero-length name
Doesn't affect normal usage by Prosody since neither A nor AAAA records
use this and SRV records has the host name last so the position is not
needed.
--- a/util/dns.lua Wed Feb 02 17:31:39 2022 +0100
+++ b/util/dns.lua Sun Oct 04 21:27:20 2020 +0200
@@ -40,7 +40,7 @@
-- No support for pointers, but libunbound appears to take care of that.
local function readDnsName(packet, pos)
- if s_byte(packet, pos) == 0 then return "."; end
+ if s_byte(packet, pos) == 0 then return ".", pos+1; end
local pack_len, r, len = #packet, {};
pos = pos or 1;
repeat