From: Remi Gacogne Date: Thu, 18 Nov 2021 15:12:42 +0000 (+0100) Subject: dnsdist: Fix Lua parameters bound checks X-Git-Tag: dnsdist-1.7.0-beta2~18^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11007%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix Lua parameters bound checks --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index fde21a9fcc..cb515c8148 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -242,8 +242,8 @@ static void parseTLSConfig(TLSConfig& config, const std::string& context, boost: static void checkParameterBound(const std::string& parameter, uint64_t value, size_t max = std::numeric_limits::max()) { - if (value > std::numeric_limits::max()) { - throw std::runtime_error("The value passed to " + parameter + " is too large, the maximum is " + std::to_string(max)); + if (value > max) { + throw std::runtime_error("The value (" + std::to_string(value) + ") passed to " + parameter + " is too large, the maximum is " + std::to_string(max)); } }