]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3991] Fixed CWE 398 iterateByValue
authorFrancis Dupont <fdupont@isc.org>
Tue, 12 May 2026 21:32:18 +0000 (23:32 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 27 May 2026 20:03:02 +0000 (22:03 +0200)
src/lib/util/tests/filesystem_unittests.cc

index 52ac1ffe84d26307eae1d727f76b12e8c9165e5b..f4d172e0f973ce7c7dbc938ebe846646b09e6404 100644 (file)
@@ -397,7 +397,7 @@ TEST_F(PathCheckerTest, validatePathEnforcePath) {
 
     // Create a PathChecker with a supported path of def_path.
     PathChecker checker(def_path);
-    for (auto scenario : scenarios) {
+    for (auto const& scenario : scenarios) {
         std::ostringstream oss;
         oss << " Scenario at line: " << scenario.line_;
         SCOPED_TRACE(oss.str());
@@ -489,7 +489,7 @@ TEST_F(PathCheckerTest, validatePathEnforcePathFalse) {
 
     // Create a PathChecker with a supported path of def_path.
     PathChecker checker(def_path);
-    for (auto scenario : scenarios) {
+    for (auto const& scenario : scenarios) {
         std::ostringstream oss;
         oss << " Scenario at line: " << scenario.line_;
         SCOPED_TRACE(oss.str());
@@ -570,7 +570,7 @@ TEST_F(PathCheckerTest, validateDirectoryEnforcePath) {
 
     // Create a PathChecker with a supported path of def_path.
     PathChecker checker(def_path);
-    for (auto scenario : scenarios) {
+    for (auto const& scenario : scenarios) {
         std::ostringstream oss;
         oss << " Scenario at line: " << scenario.line_;
         SCOPED_TRACE(oss.str());
@@ -634,7 +634,7 @@ TEST_F(PathCheckerTest, validateDirectoryEnforcePathFalse) {
 
     // Create a PathChecker with a supported path of def_path.
     PathChecker checker(def_path);
-    for (auto scenario : scenarios) {
+    for (auto const& scenario : scenarios) {
         std::ostringstream oss;
         oss << " Scenario at line: " << scenario.line_;
         SCOPED_TRACE(oss.str());