From 9b0bcb18afa0e6888bffafde63c4bdf3edbb67d2 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 5 Feb 2026 11:41:48 +0100 Subject: [PATCH] base64: Use `unsigned` constants Signed-off-by: Remi Gacogne --- pdns/base64.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/base64.cc b/pdns/base64.cc index 1ef8d2fc98..08a3261320 100644 --- a/pdns/base64.cc +++ b/pdns/base64.cc @@ -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::max() / 7 || src.length() > std::numeric_limits::max()) { + if (src.length() > std::numeric_limits::max() / 7U || src.length() > std::numeric_limits::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_new(BIO_s_mem()), BIO_free_all); if (!bio) { -- 2.47.3