1 Star 0 Fork 10

jinlun/dim_9

forked from src-openEuler/dim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-NULL-pointer-reference-when-kill-child-processes.patch 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
From a8ce34c0c661683fe33ef79be2b5b6819d4adfde Mon Sep 17 00:00:00 2001
From: jinlun <jinlun@huawei.com>
Date: Mon, 17 Jun 2024 14:54:40 +0800
Subject: [PATCH 02/14] Fix NULL pointer reference when kill child processes
---
.../tasks/dim_core_measure_process/dim_core_measure_process.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/tasks/dim_core_measure_process/dim_core_measure_process.c b/src/core/tasks/dim_core_measure_process/dim_core_measure_process.c
index e5e262a..c1efa02 100644
--- a/src/core/tasks/dim_core_measure_process/dim_core_measure_process.c
+++ b/src/core/tasks/dim_core_measure_process/dim_core_measure_process.c
@@ -89,8 +89,8 @@ static int kill_task_tree(struct task_struct *tsk)
return -ENOMEM;
dim_core_kernel_symbol.walk_process_tree(tsk, store_task_tree, &ctx);
- if (ctx.len != 0) {
- for (i = ctx.len; i >= 0; i--) {
+ if (ctx.len > 0) {
+ for (i = ctx.len - 1; i >= 0; i--) {
send_sig(SIGKILL, ctx.buf[i], 1);
put_task_struct(ctx.buf[i]);
}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlun123123/dim_9.git
git@gitee.com:jinlun123123/dim_9.git
jinlun123123
dim_9
dim_9
master

搜索帮助