From 4e259dad6e868e3528cb02a59957638c5735b2b1 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 13 Sep 2023 12:07:08 +0200 Subject: [PATCH] rec: Fix Coverityy 1519054: Using invalid iterator --- pdns/recursordist/settings/cxxsupport.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdns/recursordist/settings/cxxsupport.cc b/pdns/recursordist/settings/cxxsupport.cc index 84c3f1c455..bde1a244a3 100644 --- a/pdns/recursordist/settings/cxxsupport.cc +++ b/pdns/recursordist/settings/cxxsupport.cc @@ -491,7 +491,10 @@ std::string pdns::settings::rec::defaultsToYaml() withHelp = true; } if (withHelp) { - auto oldname = std::string(map.find(make_pair(section, field))->second.old_name); + std::string oldname; + if (auto iter = map.find(make_pair(section, field)); iter != map.end()) { + oldname = std::string(iter->second.old_name); + } res += "##### "; res += arg().getHelp(oldname); res += '\n'; -- 2.47.2