aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-09 15:35:03 +0200
committerKim Alvefur <zash@zash.se>2018-06-09 15:35:03 +0200
commit80e86b6726e31edd657a8c38cd9065640407dcf3 (patch)
tree0f11557feaea88338eda25d2b8a3fb2dc9afcc85 /net/dns.lua
parent14749255694d18a8c80143cd63cee977716fb049 (diff)
downloadprosody-80e86b6726e31edd657a8c38cd9065640407dcf3.tar.gz
prosody-80e86b6726e31edd657a8c38cd9065640407dcf3.zip
net.dns: Don't attempt to cache unparsed data (fixes #1056)
rr[qtype:lower()] can be nil. I think this happens if the type does not have a parser. Also see #819 #976
Diffstat (limited to 'net/dns.lua')
-rw-r--r--net/dns.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dns.lua b/net/dns.lua
index b69ba953..8a7d4e7a 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -672,7 +672,7 @@ function resolver:remember(rr, type) -- - - - - - - - - - - - - - remember
self.cache = self.cache or setmetatable({}, cache_metatable);
local rrs = get(self.cache, qclass, type, qname) or
set(self.cache, qclass, type, qname, setmetatable({}, rrs_metatable));
- if not rrs[rr[qtype:lower()]] then
+ if rr[qtype:lower()] and not rrs[rr[qtype:lower()]] then
rrs[rr[qtype:lower()]] = true;
append(rrs, rr);
end