From d7adeb0e23b359096cca5e1e7691f41167786b94 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 9 Jun 2018 15:35:03 +0200 Subject: 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 --- net/dns.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') 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 -- cgit v1.2.3