From 29238183e9fd345cd0e60eeb59cfe179223cc3ea Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 4 Oct 2020 21:27:20 +0200 Subject: 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. --- util/dns.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/dns.lua b/util/dns.lua index 146c6343..f086f2c1 100644 --- a/util/dns.lua +++ b/util/dns.lua @@ -40,7 +40,7 @@ local parsers = {}; -- 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 -- cgit v1.2.3