diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c index 3189798cf4b64337760fa248729ea8f98be66e27..c8bf31c8e221c12310016ebc8d050994cf765dfa 100644 --- a/engines/ccgost/gost_pmeth.c +++ b/engines/ccgost/gost_pmeth.c @@ -106,6 +106,11 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) return 1; case EVP_PKEY_CTRL_SET_IV: pctx->shared_ukm=OPENSSL_malloc((int)p1); + if (pctx->shared_ukm == NULL) + { + GOSTerr(GOST_F_PKEY_GOST_CTRL, ERR_R_MALLOC_FAILURE); + return 0; + } memcpy(pctx->shared_ukm,p2,(int) p1); return 1; case EVP_PKEY_CTRL_PEER_KEY: