12 Star 0 Fork 13

src-openEuler/checkpolicy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-checkpolicy-free-identifiers-on-invalid-typebounds.patch 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
wjiang 提交于 2025-03-14 14:45 +08:00 . backport patches from upstream
From 9f2f9e28475abfaf9c2c756726f6f829c9183308 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Sat, 30 Mar 2024 14:35:01 +0100
Subject: [PATCH] checkpolicy: free identifiers on invalid typebounds
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Free the two identifiers on an invalid typebounds in the error branch,
similar to the success branch.
Reported-by: oss-fuzz (issue 67700)
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
---
policy_define.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/policy_define.c b/policy_define.c
index 0cf938ea..92d1e5f2 100644
--- a/policy_define.c
+++ b/policy_define.c
@@ -1461,8 +1461,12 @@ int define_typebounds(void)
}
while ((id = queue_remove(id_queue))) {
- if (define_typebounds_helper(bounds, id))
+ if (define_typebounds_helper(bounds, id)) {
+ free(bounds);
+ free(id);
return -1;
+ }
+
free(id);
}
free(bounds);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/checkpolicy.git
git@gitee.com:src-openeuler/checkpolicy.git
src-openeuler
checkpolicy
checkpolicy
master

搜索帮助