From: Remi Gacogne Date: Mon, 15 Oct 2018 15:43:50 +0000 (+0200) Subject: dnsdist: Check 'numberOfStoredSessions' >= 0, dismiss otherwise X-Git-Tag: dnsdist-1.3.3~41^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7062%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Check 'numberOfStoredSessions' >= 0, dismiss otherwise --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 960fdc2f1d..9f1db9f3ff 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -1543,7 +1543,13 @@ void setupLuaConfig(bool client) } if (vars->count("numberOfStoredSessions")) { - frontend->d_maxStoredSessions = boost::get((*vars)["numberOfStoredSessions"]); + auto value = boost::get((*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; } }