diff options
author | Jonas Maebe <jonas.maebe@elis.ugent.be> | 2013-12-08 22:54:33 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2014-12-04 23:48:43 +0100 |
commit | 787e9929652e5f1e7e7cf9f7df4e8613a1d84ea9 (patch) | |
tree | c0fb711a857a76fd19ed263e80de929ef2a67a5d /engines/ccgost | |
parent | 12478cc449ea3fe49b8e1590c62af891ae108d11 (diff) | |
download | openssl-787e9929652e5f1e7e7cf9f7df4e8613a1d84ea9.tar.gz |
pkey_gost_ctrl: check for NULL after allocating pctx->shared_ukm
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'engines/ccgost')
-rw-r--r-- | engines/ccgost/gost_pmeth.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c index 3189798cf4..c8bf31c8e2 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: |