diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index dce0774e8fa632..2c2e73bc7dc800 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -767,9 +767,10 @@ static bool PrintGeneralName(const BIOPointer& out, const GENERAL_NAME* gen) { return false; } char* oline = nullptr; - size_t n_bytes = BIO_get_mem_data(tmp.get(), &oline); + long n_bytes = BIO_get_mem_data(tmp.get(), &oline); // NOLINT(runtime/int) + CHECK_GE(n_bytes, 0); CHECK_IMPLIES(n_bytes != 0, oline != nullptr); - PrintAltName(out, oline, n_bytes, true, nullptr); + PrintAltName(out, oline, static_cast(n_bytes), true, nullptr); } else if (gen->type == GEN_IPADD) { BIO_printf(out.get(), "IP Address:"); const ASN1_OCTET_STRING* ip = gen->d.ip;