mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
engine_md_copy: check for NULL after allocating to_md->HashBuffer
Signed-off-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
9f01a8acb3
commit
94c0a987c7
@ -1507,6 +1507,8 @@ static int engine_md_copy ( EVP_MD_CTX *to, const EVP_MD_CTX *from )
|
||||
ZEN_MD_DATA *to_md = (ZEN_MD_DATA *) to->md_data ;
|
||||
|
||||
to_md->HashBuffer = OPENSSL_malloc ( from_md->HashBufferSize ) ;
|
||||
if (to_md->HashBuffer == NULL)
|
||||
return 0;
|
||||
memcpy ( to_md->HashBuffer, from_md->HashBuffer, from_md->HashBufferSize ) ;
|
||||
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user