Don't set ctx->cipher until after a successful fetch
If an implict EVP_CIPHER_fetch fails then ctx->cipher should not be set otherwise strange things will happen when trying to free the ctx. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9531)
This commit is contained in:
parent
e9c116ebcb
commit
7f612b1f04
1 changed files with 1 additions and 3 deletions
|
@ -197,9 +197,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
|
|||
ctx->flags = flags;
|
||||
}
|
||||
|
||||
if (cipher != NULL)
|
||||
ctx->cipher = cipher;
|
||||
else
|
||||
if (cipher == NULL)
|
||||
cipher = ctx->cipher;
|
||||
|
||||
if (cipher->prov == NULL) {
|
||||
|
|
Loading…
Reference in a new issue