aboutsummaryrefslogtreecommitdiffstats
path: root/util/dns.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-10-04 21:27:20 +0200
committerKim Alvefur <zash@zash.se>2020-10-04 21:27:20 +0200
commit29238183e9fd345cd0e60eeb59cfe179223cc3ea (patch)
tree8eab27416f5531b81ae7f14e078645166722bc99 /util/dns.lua
parentc0be07a6b600329d3765c8baa14dc37eb8552620 (diff)
downloadprosody-29238183e9fd345cd0e60eeb59cfe179223cc3ea.tar.gz
prosody-29238183e9fd345cd0e60eeb59cfe179223cc3ea.zip
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.
Diffstat (limited to 'util/dns.lua')
-rw-r--r--util/dns.lua2
1 files changed, 1 insertions, 1 deletions
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