]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix Lua parameters bound checks 11007/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 18 Nov 2021 15:12:42 +0000 (16:12 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 18 Nov 2021 15:12:42 +0000 (16:12 +0100)
pdns/dnsdist-lua.cc

index fde21a9fccb47b5f95b6d308d060f91e487e40bb..cb515c8148a0d5d4c07bfa66e1b2f82b89e561a4 100644 (file)
@@ -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<uint16_t>::max())
 {
-  if (value > std::numeric_limits<uint16_t>::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));
   }
 }