diff options
author | Jonas Maebe <jonas.maebe@elis.ugent.be> | 2013-12-08 22:49:19 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2014-08-17 18:56:44 +0200 |
commit | 94c0a987c77d88d98d45ae8f52c568f6f7448ce3 (patch) | |
tree | 39ac228a0411b0748a62a95a27da7efffe2d55bb | |
parent | 9f01a8acb3a6faf116278beebc1f376319f5cfe5 (diff) |
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>
-rw-r--r-- | demos/engines/zencod/hw_zencod.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/demos/engines/zencod/hw_zencod.c b/demos/engines/zencod/hw_zencod.c index 4234b93cbe..9ad7252391 100644 --- a/demos/engines/zencod/hw_zencod.c +++ b/demos/engines/zencod/hw_zencod.c @@ -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; |