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
commit41c516a23b7cd04dbc551342f1f076054cc0c0c3 (patch)
tree38eb7a5e252ed5faa8e76893ddc332b7e97408c4 /src/lib/libssl/ssl_lib.c
parent5e9669b813b32f5d5ca2ccb554e53000bd5a44d2 (diff)
downloadopenbsd-41c516a23b7cd04dbc551342f1f076054cc0c0c3.tar.gz
openbsd-41c516a23b7cd04dbc551342f1f076054cc0c0c3.tar.bz2
openbsd-41c516a23b7cd04dbc551342f1f076054cc0c0c3.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}