summaryrefslogtreecommitdiffstats
path: root/crypto/evp/digest.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2016-01-21 20:53:18 +0100
committerRich Salz <rsalz@openssl.org>2016-02-11 18:13:18 +0100
commit84c15091ec4b694d7a10a3d0fa1c42a30e9d1b21 (patch)
treec86dddad5f7d399df5f2bb22e157c7a8adc45216 /crypto/evp/digest.c
parentMake util/mkrc.pl location agnostic and adapt Makefile.shared (diff)
downloadopenssl-84c15091ec4b694d7a10a3d0fa1c42a30e9d1b21.tar.xz
openssl-84c15091ec4b694d7a10a3d0fa1c42a30e9d1b21.zip
Fix GH 327.
Valgrind complains about using unitialized memory. So call OPENSSL_zalloc, not malloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/evp/digest.c')
-rw-r--r--crypto/evp/digest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index 1fc58bd2f4..f7e82db6dd 100644
--- a/crypto/evp/digest.c
+++ b/crypto/evp/digest.c
@@ -229,7 +229,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
ctx->digest = type;
if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) {
ctx->update = type->update;
- ctx->md_data = OPENSSL_malloc(type->ctx_size);
+ ctx->md_data = OPENSSL_zalloc(type->ctx_size);
if (ctx->md_data == NULL) {
EVPerr(EVP_F_EVP_DIGESTINIT_EX, ERR_R_MALLOC_FAILURE);
return 0;