dev_crypto_md5_copy: return error if allocating to_md->data fails

Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Jonas Maebe 2013-12-08 18:11:34 +01:00 committed by Kurt Roeckx
parent 771e0c6c7a
commit 6f77f82bfc

View File

@ -427,6 +427,8 @@ static int dev_crypto_md5_copy(EVP_MD_CTX *to,const EVP_MD_CTX *from)
assert(from->digest->flags&EVP_MD_FLAG_ONESHOT);
to_md->data=OPENSSL_malloc(from_md->len);
if (to_md->data == NULL)
return 0;
memcpy(to_md->data,from_md->data,from_md->len);
return 1;