From: Sven Wegener Date: Sat, 2 Apr 2022 13:35:09 +0000 (+0200) Subject: Prevent segfault with empty allow-from-file and allow-from options X-Git-Tag: rec-4.7.0-beta1~20^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11496%2Fhead;p=thirdparty%2Fpdns.git Prevent segfault with empty allow-from-file and allow-from options Always return a valid NetmaskGroup from parseACL() --- 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)