13 Star 0 Fork 6

ocs-commit/dbus-broker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fedceff76af876d3069d4df2eedd0a974d16c3ff.patch 1.77 KB
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2024-12-25 11:18 . - Apply patches from rpm-tracker
From fedceff76af876d3069d4df2eedd0a974d16c3ff Mon Sep 17 00:00:00 2001
From: David Rheinsberg <david@readahead.eu>
Date: Thu, 1 Aug 2024 14:58:12 +0200
Subject: [PATCH] launch/policy: deallocate unused records during import
When records are imported, but never linked to any policy list, we
currently leak the records. Fix this and properly deallocate the records
in those cases.
Note that this only happens when invalid uids/gids are specified, which
is not common for production systems.
Reported-by: Evgeny Vereshchagin <evvers@ya.ru>
Reported-by: Frantisek Sumsal <frantisek@sumsal.cz>
Signed-off-by: David Rheinsberg <david@readahead.eu>
---
src/launch/policy.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/launch/policy.c b/src/launch/policy.c
index a72cb606..803336fc 100644
--- a/src/launch/policy.c
+++ b/src/launch/policy.c
@@ -405,7 +405,8 @@ static int policy_import_own(Policy *policy, ConfigNode *cnode) {
c_list_link_tail(&policy->default_entries.own_list, &record->link);
}
- record = NULL;
+ if (c_list_is_linked(&record->link))
+ record = NULL;
return 0;
}
@@ -497,7 +498,8 @@ static int policy_import_send(Policy *policy, ConfigNode *cnode) {
c_list_link_tail(&policy->default_entries.send_list, &record->link);
}
- record = NULL;
+ if (c_list_is_linked(&record->link))
+ record = NULL;
return 0;
}
@@ -589,7 +591,8 @@ static int policy_import_recv(Policy *policy, ConfigNode *cnode) {
c_list_link_tail(&policy->default_entries.recv_list, &record->link);
}
- record = NULL;
+ if (c_list_is_linked(&record->link))
+ record = NULL;
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-commit/dbus-broker.git
git@gitee.com:ocs-commit/dbus-broker.git
ocs-commit
dbus-broker
dbus-broker
master

搜索帮助