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:
parent
771e0c6c7a
commit
6f77f82bfc
@ -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);
|
assert(from->digest->flags&EVP_MD_FLAG_ONESHOT);
|
||||||
|
|
||||||
to_md->data=OPENSSL_malloc(from_md->len);
|
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);
|
memcpy(to_md->data,from_md->data,from_md->len);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user