summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorjsing <>2014-05-28 13:07:47 +0000
committerjsing <>2014-05-28 13:07:47 +0000
commit11b7ce9aaed6e67e7fb23fa5c3febf635a5e7c81 (patch)
tree38eb7a5e252ed5faa8e76893ddc332b7e97408c4 /src/lib/libssl/ssl_lib.c
parent1904ce01988b6ea0f5775507b4d812459c5b3f50 (diff)
downloadopenbsd-11b7ce9aaed6e67e7fb23fa5c3febf635a5e7c81.tar.gz
openbsd-11b7ce9aaed6e67e7fb23fa5c3febf635a5e7c81.tar.bz2
openbsd-11b7ce9aaed6e67e7fb23fa5c3febf635a5e7c81.zip
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@
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c2
1 files changed, 1 insertions, 1 deletions
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)
3235{ 3235{
3236 ssl_clear_hash_ctx(hash); 3236 ssl_clear_hash_ctx(hash);
3237 *hash = EVP_MD_CTX_create(); 3237 *hash = EVP_MD_CTX_create();
3238 if (md) 3238 if (*hash != NULL && md != NULL)
3239 EVP_DigestInit_ex(*hash, md, NULL); 3239 EVP_DigestInit_ex(*hash, md, NULL);
3240 return (*hash); 3240 return (*hash);
3241} 3241}