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>
This commit is contained in:
Jonas Maebe 2013-12-08 22:54:58 +01:00 committed by Kurt Roeckx
parent 787e992965
commit 0716f9e405

View File

@ -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;