From 1cf3aa8062f967d392892527af27e8b6e30a6e01 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 18 Nov 2021 16:12:42 +0100 Subject: [PATCH] dnsdist: Fix Lua parameters bound checks --- pdns/dnsdist-lua.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); } } -- 2.47.2