From: Remi Gacogne Date: Mon, 10 Nov 2025 12:36:01 +0000 (+0100) Subject: dnsdist: Fix a crash when a selector cannot be found by its name X-Git-Tag: rec-5.4.0-alpha1~91^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fae47992f72cb67efc74388c8871263764f41236;p=thirdparty%2Fpdns.git dnsdist: Fix a crash when a selector cannot be found by its name Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc index d97f8898b2..87cbea697a 100644 --- a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc +++ b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc @@ -1910,7 +1910,11 @@ std::shared_ptr getNotSelector(const NotSelectorConfiguration& conf std::shared_ptr getByNameSelector(const ByNameSelectorConfiguration& config) { - return dnsdist::configuration::yaml::getRegisteredTypeByName(config.selector_name); + auto ptr = dnsdist::configuration::yaml::getRegisteredTypeByName(config.selector_name); + if (!ptr) { + throw std::runtime_error("Unable find a selector named " + std::string(config.selector_name)); + } + return ptr; } #include "dnsdist-rust-bridge-actions-generated-body.hh"