diff options
author | 2014-05-28 13:07:47 +0000 | |
---|---|---|
committer | 2014-05-28 13:07:47 +0000 | |
commit | cdce7c5949509f0df5831dc71eb1a78f168b1b5a (patch) | |
tree | f56bf5e77ae5a627afb21143af1515337a5a56e2 /lib/libssl/src/ssl/ssl_lib.c | |
parent | There is no point in checking if a pointer is non-NULL before calling free, (diff) | |
download | wireguard-openbsd-cdce7c5949509f0df5831dc71eb1a78f168b1b5a.tar.xz wireguard-openbsd-cdce7c5949509f0df5831dc71eb1a78f168b1b5a.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 'lib/libssl/src/ssl/ssl_lib.c')
-rw-r--r-- | lib/libssl/src/ssl/ssl_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libssl/src/ssl/ssl_lib.c b/lib/libssl/src/ssl/ssl_lib.c index bf983542941..12d45ea0251 100644 --- a/lib/libssl/src/ssl/ssl_lib.c +++ b/lib/libssl/src/ssl/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); } |