12 Star 2 Fork 53

src-openEuler/util-linux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-lib-caputils-fix-integer-handling-issues-coverity-sc.patch 781 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhangyao2022 提交于 2023-06-15 14:33 . sync community patches
From 01a0a556018694bfaf6b01a5a40f8d0d10641a1f Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 18 May 2023 10:26:02 +0200
Subject: [PATCH] lib/caputils: fix integer handling issues [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
---
lib/caputils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/caputils.c b/lib/caputils.c
index 3041c3078..23866c071 100644
--- a/lib/caputils.c
+++ b/lib/caputils.c
@@ -119,7 +119,7 @@ void cap_permitted_to_ambient(void)
if (cap > (uint64_t) cap_last_cap())
continue;
- if ((effective & (1 << cap))
+ if ((effective & (1ULL << cap))
&& prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, cap, 0, 0) < 0)
err(EXIT_FAILURE, _("prctl(PR_CAP_AMBIENT) failed"));
}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/util-linux.git
git@gitee.com:src-openeuler/util-linux.git
src-openeuler
util-linux
util-linux
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385