summaryrefslogtreecommitdiffstats
path: root/crypto/evp/pmeth_gn.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-08-11 17:01:07 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-08-24 11:19:28 +1000
commit10ead93897ab48233d66cc40bfdc146d6c95c4a7 (patch)
tree5f3b9f1766c6d801453fb1edbad01f4ef5d001e9 /crypto/evp/pmeth_gn.c
parentdb1319b706b8f3b0d8d05d766da720812afc28c6 (diff)
Fix coverity CID #1455335 - Dereference after NULL check in fromdata_init()
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12628)
Diffstat (limited to 'crypto/evp/pmeth_gn.c')
-rw-r--r--crypto/evp/pmeth_gn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c
index 2f9346d998..3096828678 100644
--- a/crypto/evp/pmeth_gn.c
+++ b/crypto/evp/pmeth_gn.c
@@ -375,7 +375,8 @@ static int fromdata_init(EVP_PKEY_CTX *ctx, int operation)
return 1;
not_supported:
- ctx->operation = EVP_PKEY_OP_UNDEFINED;
+ if (ctx != NULL)
+ ctx->operation = EVP_PKEY_OP_UNDEFINED;
ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
return -2;
}