Handle NULL parameter in some EVP utility functions.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 31 May 2007 12:39:21 +0000 (12:39 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 31 May 2007 12:39:21 +0000 (12:39 +0000)
crypto/evp/evp_lib.c

index e4d5b682f3c92b822e7f13cc15d2567a3cc34872..daccb668202bf040a546dcb960e86c304102a828 100644 (file)
@@ -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;
        }