16 Star 10 Fork 102

src-openEuler/systemd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-exec-invoke-correct-dont_close-size.patch 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
w30023233 提交于 2024-12-24 16:16 +08:00 . sync patches from systemd community
From 8f4dab049074d31c31af2bb9eb76f9f4f08e3711 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 23 Apr 2024 21:49:12 +0200
Subject: [PATCH] exec-invoke: correct dont_close[] size
THis needs 15 entries as far as I can count, not just 14.
Follow-up for: 5686391b006ee82d8a4559067ad9818e3e631247
Sniff.
(cherry picked from commit 07296542d636dcac43f6c9ee45a638fca8c5f3dd)
Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/8f4dab049074d31c31af2bb9eb76f9f4f08e3711
---
src/core/exec-invoke.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c
index 28d6142318..8e6de15c71 100644
--- a/src/core/exec-invoke.c
+++ b/src/core/exec-invoke.c
@@ -3459,7 +3459,7 @@ static int close_remaining_fds(
const int *fds, size_t n_fds) {
size_t n_dont_close = 0;
- int dont_close[n_fds + 14];
+ int dont_close[n_fds + 15];
assert(params);
@@ -3495,6 +3495,8 @@ static int close_remaining_fds(
if (params->user_lookup_fd >= 0)
dont_close[n_dont_close++] = params->user_lookup_fd;
+ assert(n_dont_close <= ELEMENTSOF(dont_close));
+
return close_all_fds(dont_close, n_dont_close);
}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/systemd.git
git@gitee.com:src-openeuler/systemd.git
src-openeuler
systemd
systemd
master

搜索帮助