]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
base64: Use `unsigned` constants
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 5 Feb 2026 10:41:48 +0000 (11:41 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 5 Feb 2026 10:58:09 +0000 (11:58 +0100)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/base64.cc

index 1ef8d2fc9844b2da00498964a09392e849a15b98..08a3261320f7ccabf02467b53ba375d22dd5d889 100644 (file)
@@ -39,10 +39,10 @@ int B64Decode(const std::string& src, Container& dst)
     return 0;
   }
   // check if the dlen computation might overflow or it does not fit into an int (for IO_write)
-  if (src.length() > std::numeric_limits<size_t>::max() / 7 || src.length() > std::numeric_limits<int>::max()) {
+  if (src.length() > std::numeric_limits<size_t>::max() / 7U || src.length() > std::numeric_limits<int>::max()) {
     throw std::runtime_error("B64Decode too large");
   }
-  const size_t dlen = (src.length() * 6 + 7) / 8;
+  const size_t dlen = (src.length() * 6U + 7U) / 8U;
   dst.resize(dlen);
   auto bio = std::unique_ptr<BIO, void (*)(BIO*)>(BIO_new(BIO_s_mem()), BIO_free_all);
   if (!bio) {