From 2d25719a694f4d96e8645d66bc53597d82e23621 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 16 Dec 2019 16:32:49 +0100 Subject: [PATCH] Reuse the same variable --- dnscrypt-proxy/pattern_matcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnscrypt-proxy/pattern_matcher.go b/dnscrypt-proxy/pattern_matcher.go index 00117546..ef4beeea 100644 --- a/dnscrypt-proxy/pattern_matcher.go +++ b/dnscrypt-proxy/pattern_matcher.go @@ -122,7 +122,7 @@ func (patternMatcher *PatternMatcher) Eval(qName string) (reject bool, reason st revQname := StringReverse(qName) if match, xval, found := patternMatcher.blockedSuffixes.LongestPrefix([]byte(revQname)); found { - if len(match) == len(qName) || revQname[len(match)] == '.' { + if len(match) == len(revQname) || revQname[len(match)] == '.' { return true, "*." + StringReverse(string(match)), xval } if len(match) < len(revQname) && len(revQname) > 0 {