Commit 6f77f82b authored by Jonas Maebe's avatar Jonas Maebe Committed by Kurt Roeckx
Browse files

dev_crypto_md5_copy: return error if allocating to_md->data fails



Signed-off-by: default avatarKurt Roeckx <kurt@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 771e0c6c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);

    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);

    return 1;