diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index e4d5b682f3c92b822e7f13cc15d2567a3cc34872..daccb668202bf040a546dcb960e86c304102a828 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -255,11 +255,15 @@ int EVP_MD_pkey_type(const EVP_MD *md) int EVP_MD_size(const EVP_MD *md) { + if (!md) + return -1; return md->md_size; } const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx) { + if (!ctx) + return NULL; return ctx->digest; }