From 6f77f82bfcdf40c41e095bf292e887d15f2bf69d Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 8 Dec 2013 18:11:34 +0100 Subject: [PATCH] dev_crypto_md5_copy: return error if allocating to_md->data fails Signed-off-by: Kurt Roeckx Reviewed-by: Rich Salz --- crypto/evp/openbsd_hw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/evp/openbsd_hw.c b/crypto/evp/openbsd_hw.c index 78ad707ad8..b746c46967 100644 --- a/crypto/evp/openbsd_hw.c +++ b/crypto/evp/openbsd_hw.c @@ -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; -- 2.25.1