coverity 1462573 Dereference after null check

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)
This commit is contained in:
Pauli 2020-04-27 09:17:48 +10:00
parent cb383f10d1
commit 5e12a13af7

View File

@ -93,7 +93,7 @@ static int gen_init(EVP_PKEY_CTX *ctx, int operation)
#endif
end:
if (ret <= 0)
if (ret <= 0 && ctx != NULL)
ctx->operation = EVP_PKEY_OP_UNDEFINED;
return ret;