libwd/0042-uadk-v1-fix-long-hash-state-issue.patch
2023-10-31 16:59:15 +08:00

31 lines
912 B
Diff

From bd3c4738ff9c6891a206ed7f77e80379ba443f9a Mon Sep 17 00:00:00 2001
From: Weili Qian <qianweili@huawei.com>
Date: Thu, 26 Oct 2023 16:17:58 +0800
Subject: [PATCH 42/42] uadk/v1: fix long hash state issue
'iv_bytes' in msg is used as the packet status in the long hash service.
If initial value is not 0, the long hash calculation may be abnormal.
Therefore, initialize the cookie to 0.
Signed-off-by: Weili Qian <qianweili@huawei.com>
---
v1/wd_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v1/wd_util.c b/v1/wd_util.c
index 6b8f944..a1d08b4 100644
--- a/v1/wd_util.c
+++ b/v1/wd_util.c
@@ -87,7 +87,7 @@ int wd_init_cookie_pool(struct wd_cookie_pool *pool,
{
__u64 total_size = cookies_size * cookies_num;
- pool->cookies = malloc(total_size + cookies_num);
+ pool->cookies = calloc(1, total_size + cookies_num);
if (!pool->cookies)
return -WD_ENOMEM;
--
2.25.1