From: Pauli Date: Thu, 14 Sep 2017 22:01:42 +0000 (+1000) Subject: Add explanatory comment about fitting into a size_t. X-Git-Tag: OpenSSL_1_1_1-pre1~653 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=44589b5d44217aacbceff08f8317c2a0a4e0ff40;p=oweals%2Fopenssl.git Add explanatory comment about fitting into a size_t. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/4373) --- diff --git a/crypto/evp/pbe_scrypt.c b/crypto/evp/pbe_scrypt.c index 80a1acd2ce..b30e6d5719 100644 --- a/crypto/evp/pbe_scrypt.c +++ b/crypto/evp/pbe_scrypt.c @@ -207,6 +207,8 @@ int EVP_PBE_scrypt(const char *pass, size_t passlen, if (maxmem == 0) maxmem = SCRYPT_MAX_MEM; + + /* Check that the maximum memory doesn't exceed a size_t limits */ if (maxmem > SIZE_MAX) maxmem = SIZE_MAX;