From 0848ca0e69e3c535b70e2d1f7e8c24f0e1941ee9 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Thu, 21 May 2020 14:48:31 +0300 Subject: [PATCH] - rewrites: fix crash when handling name->cname->A chain crash.adguard -> adguard.a.record adguard.a.record -> 1.2.3.4 --- dnsforward/handle_dns.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dnsforward/handle_dns.go b/dnsforward/handle_dns.go index 8478c426..7aabd25e 100644 --- a/dnsforward/handle_dns.go +++ b/dnsforward/handle_dns.go @@ -211,6 +211,9 @@ func processFilteringAfterResponse(ctx *dnsContext) int { switch res.Reason { case dnsfilter.ReasonRewrite: + if d.Res != nil { + break // response is already prepared + } if len(res.CanonName) == 0 { break }