summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}