mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
Fix GH 327.
Valgrind complains about using unitialized memory. So call OPENSSL_zalloc, not malloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
1407f856ab
commit
84c15091ec
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user