From bc79df66b355c0988cc2ae50d4f3179f11634a08 Mon Sep 17 00:00:00 2001 From: Sven Wegener Date: Sat, 2 Apr 2022 15:35:09 +0200 Subject: [PATCH] Prevent segfault with empty allow-from-file and allow-from options Always return a valid NetmaskGroup from parseACL() --- pdns/recursordist/rec-main.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index cbf4c85a8a..6fef73efbb 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -958,8 +958,6 @@ static std::shared_ptr parseACL(const std::string& aclFile, const result->addMask(line); } g_log << Logger::Info << "Done parsing " << result->size() << " " << aclSetting << " ranges from file '" << ::arg()[aclFile] << "' - overriding '" << aclSetting << "' setting" << endl; - - return result; } else if (!::arg()[aclSetting].empty()) { vector ips; @@ -973,11 +971,9 @@ static std::shared_ptr parseACL(const std::string& aclFile, const g_log << Logger::Info << *i; } g_log << Logger::Info << endl; - - return result; } - return nullptr; + return result; } static void* pleaseSupplantAllowFrom(std::shared_ptr ng) -- 2.47.2