
29 Mar
2024
29 Mar
'24
10:13 a.m.
Add result check of EVP_MD_CTX_new(). Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com> --- src/uadk_digest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/uadk_digest.c b/src/uadk_digest.c index 8ab1b83..43bbf60 100644 --- a/src/uadk_digest.c +++ b/src/uadk_digest.c @@ -204,6 +204,8 @@ static int digest_soft_init(struct digest_priv_ctx *md_ctx) /* Allocate a soft ctx for hardware engine */ if (md_ctx->soft_ctx == NULL) md_ctx->soft_ctx = EVP_MD_CTX_new(); + if (md_ctx->soft_ctx == NULL) + return 0; ctx = md_ctx->soft_ctx; -- 2.33.0