Ensure all EVP calls have their returns checked where appropriate
There are lots of calls to EVP functions from within libssl There were various places where we should probably check the return value but don't. This adds these checks. Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
@@ -3507,8 +3507,11 @@ EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md)
|
||||
{
|
||||
ssl_clear_hash_ctx(hash);
|
||||
*hash = EVP_MD_CTX_create();
|
||||
if (md)
|
||||
EVP_DigestInit_ex(*hash, md, NULL);
|
||||
if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {
|
||||
EVP_MD_CTX_destroy(*hash);
|
||||
*hash = NULL;
|
||||
return NULL;
|
||||
}
|
||||
return *hash;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user