From 8b5f0a60efa8d0cf7f765385868f0cd622fd2979 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 25 Aug 2019 21:14:30 +0200 Subject: [PATCH] Fail on hosts-file format lines in domain-list Signed-off-by: Knut Ahlers --- provider_domainList.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/provider_domainList.go b/provider_domainList.go index 1f10a3c..51f7215 100644 --- a/provider_domainList.go +++ b/provider_domainList.go @@ -33,6 +33,11 @@ func (p providerdomainList) GetDomainList(d providerDefinition) ([]entry, error) domain := strings.TrimSpace(scanner.Text()) + if strings.Contains(domain, " ") { + logger.WithField("line", scanner.Text()).Warn("Invalid line found") + continue + } + if isBlacklisted(domain) { logger.WithField("domain", domain).Debug("Skipping because of blacklist") continue