7 Star 1 Fork 17

src-openEuler/ima-evm-utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-fix-caps-parameter-cannot-be-parsed.patch 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
zhoushuiqing 提交于 2023-07-28 15:36 . Upgrade to 1.5 with compatibility
From 24c9623f563646695f6d219b2414b23f36378b42 Mon Sep 17 00:00:00 2001
From: shenxiangwei <[email protected]>
Date: Fri, 19 Aug 2022 12:05:11 +0800
Subject: [PATCH] fix caps parameter cannot be parsed
Signed-off-by: shenxiangwei <[email protected]>
Signed-off-by: zhoushuiqing <[email protected]>
---
src/evmctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/evmctl.c b/src/evmctl.c
index 70d07a5..19175b8 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
@@ -472,14 +472,14 @@ static int calc_evm_hash(const char *file, unsigned char *hash)
} else if (!strcmp(*xattrname, XATTR_NAME_CAPS) && (hmac_flags & HMAC_FLAG_CAPS_SET)) {
if (!caps_str)
continue;
- err = strlen(caps_str);
+ hex2bin(xattr_value, caps_str, strlen(caps_str) >> 1);
+ err = strlen(caps_str) >> 1;
if (err >= sizeof(xattr_value)) {
log_err("caps[%u] value is too long to fit into xattr[%zu]\n",
err + 1, sizeof(xattr_value));
err = -1;
goto out;
}
- strcpy(xattr_value, caps_str);
} else {
err = lgetxattr(file, *xattrname, xattr_value, sizeof(xattr_value));
if (err < 0) {
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/ima-evm-utils.git
[email protected]:src-openeuler/ima-evm-utils.git
src-openeuler
ima-evm-utils
ima-evm-utils
master

搜索帮助