- rewrites: fix crash when handling name->cname->A chain

crash.adguard -> adguard.a.record
adguard.a.record -> 1.2.3.4
This commit is contained in:
Simon Zolin 2020-05-21 14:48:31 +03:00
parent 2d1cba67dc
commit 0848ca0e69
1 changed files with 3 additions and 0 deletions

View File

@ -211,6 +211,9 @@ func processFilteringAfterResponse(ctx *dnsContext) int {
switch res.Reason { switch res.Reason {
case dnsfilter.ReasonRewrite: case dnsfilter.ReasonRewrite:
if d.Res != nil {
break // response is already prepared
}
if len(res.CanonName) == 0 { if len(res.CanonName) == 0 {
break break
} }