From 41c516a23b7cd04dbc551342f1f076054cc0c0c3 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 28 May 2014 13:07:47 +0000 Subject: EVP_MD_CTX_create() calls malloc and can return NULL. However, only one of the calls in libssl actually checks the return value before using it. Add NULL checks for the remaining three calls. ok miod@ --- src/lib/libssl/ssl_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index bf98354294..12d45ea025 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -3235,7 +3235,7 @@ ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md) { ssl_clear_hash_ctx(hash); *hash = EVP_MD_CTX_create(); - if (md) + if (*hash != NULL && md != NULL) EVP_DigestInit_ex(*hash, md, NULL); return (*hash); } -- cgit v1.2.3-55-g6feb