]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Fix Coverityy 1519054: Using invalid iterator 13250/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 13 Sep 2023 10:07:08 +0000 (12:07 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 13 Sep 2023 10:07:08 +0000 (12:07 +0200)
pdns/recursordist/settings/cxxsupport.cc

index 84c3f1c455bef7a77fb333186e73109d284f5260..bde1a244a3aef7f217d88fe60022e7b1909a8c8f 100644 (file)
@@ -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';