1 Star 0 Fork 15

霍源浩/iscsi-initiator-utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0024-iscsistart-fix-null-pointer-deref-before-exit.patch 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
From b9bf7cea4769efa73e6de9b13a8d1833d2ac3d92 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 16 Jun 2021 09:55:06 -0700
Subject: [PATCH 1/1] iscsistart: fix null pointer deref before exit
Fixes regression caused by "open-iscsi: Clean user_param list when
process exit" Which is a shame, as not freeing a memory at process exit
doesn't really hurt anything.
Same change as "Fix iscsiadm segfault when exiting" applied to iscsiadm.
Fixes: b532ad67d495d42026165a26515c645995d23f18
Signed-off-by: Chris Leech <cleech@redhat.com>
---
usr/iscsistart.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/usr/iscsistart.c b/usr/iscsistart.c
index 206cd4c..7eb573e 100644
--- a/usr/iscsistart.c
+++ b/usr/iscsistart.c
@@ -361,7 +361,7 @@ int main(int argc, char *argv[])
struct boot_context *context, boot_context;
struct sigaction sa_old;
struct sigaction sa_new;
- struct user_param *param;
+ struct user_param *param, *tmp_param;
int control_fd, mgmt_ipc_fd, err;
pid_t pid;
@@ -556,7 +556,7 @@ int main(int argc, char *argv[])
mgmt_ipc_close(mgmt_ipc_fd);
free_initiator();
sysfs_cleanup();
- list_for_each_entry(param, &user_params, list) {
+ list_for_each_entry_safe(param, tmp_param, &user_params, list) {
list_del(&param->list);
idbm_free_user_param(param);
}
--
2.31.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huoyuanhao2024/iscsi-initiator-utils.git
git@gitee.com:huoyuanhao2024/iscsi-initiator-utils.git
huoyuanhao2024
iscsi-initiator-utils
iscsi-initiator-utils
a8

搜索帮助