diff options
author | Jonas Maebe <jonas.maebe@elis.ugent.be> | 2013-12-08 22:54:58 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2014-12-04 23:48:44 +0100 |
commit | 0716f9e40507b5d3f63079f10db60bab8dbc6279 (patch) | |
tree | b587d95e505c196695e42f76531bd6270e24271c /engines | |
parent | 787e9929652e5f1e7e7cf9f7df4e8613a1d84ea9 (diff) |
pkey_gost_mac_keygen: check for NULL after allocating keydata
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'engines')
-rw-r--r-- | engines/ccgost/gost_pmeth.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c index c8bf31c8e2..7ccae8657e 100644 --- a/engines/ccgost/gost_pmeth.c +++ b/engines/ccgost/gost_pmeth.c @@ -562,6 +562,8 @@ static int pkey_gost_mac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) return 0; } keydata = OPENSSL_malloc(32); + if (keydata == NULL) + return 0; memcpy(keydata,data->key,32); EVP_PKEY_assign(pkey, NID_id_Gost28147_89_MAC, keydata); return 1; |