]> granicus.if.org Git - pdns/commitdiff
dnsdist: Check 'numberOfStoredSessions' >= 0, dismiss otherwise
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 15 Oct 2018 15:43:50 +0000 (17:43 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 15 Oct 2018 15:43:50 +0000 (17:43 +0200)
pdns/dnsdist-lua.cc

index 960fdc2f1d72d9854b2f06a1374b957bbf3bbbff..9f1db9f3ffed210b35a8b7bd918fdeccfdb760b4 100644 (file)
@@ -1543,7 +1543,13 @@ void setupLuaConfig(bool client)
           }
 
           if (vars->count("numberOfStoredSessions")) {
-            frontend->d_maxStoredSessions = boost::get<int>((*vars)["numberOfStoredSessions"]);
+            auto value = boost::get<int>((*vars)["numberOfStoredSessions"]);
+            if (value < 0) {
+              errlog("Invalid value '%d' for addTLSLocal() parameter 'numberOfStoredSessions', should be >= 0, dismissing", value);
+              g_outputBuffer="Invalid value '" +  std::to_string(value) + "' for addTLSLocal() parameter 'numberOfStoredSessions', should be >= 0, dimissing";
+              return;
+            }
+            frontend->d_maxStoredSessions = value;
           }
         }