1 Star 0 Fork 40

hy/multipath-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
6003-libmultipath-fix-null-dereference-int-alloc_path_group.patch 942 Bytes
一键复制 编辑 原始数据 按行查看 历史
wangjufeng 提交于 2020-01-10 17:13 . rename the package
From 156b75082c7c5d5aa832e500cf4175c3f943fa22 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Tue, 9 Oct 2018 18:03:08 -0500
Subject: [PATCH] libmultipath: fix null dereference int alloc_path_group
If all_pathgroup failed to allocate a vector for pgp->paths, instead of
failing after it freed pgp, it would set pgp to NULL and then
dereference it. This patch fixes that. Found by coverity.
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/structs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/structs.c b/libmultipath/structs.c
index ae847d61..caa178a6 100644
--- a/libmultipath/structs.c
+++ b/libmultipath/structs.c
@@ -165,7 +165,7 @@ alloc_pathgroup (void)
if (!pgp->paths) {
FREE(pgp);
- pgp = NULL;
+ return NULL;
}
dm_pathgroup_to_gen(pgp)->ops = &dm_gen_pathgroup_ops;
--
2.11.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hy-euler/multipath-tools.git
git@gitee.com:hy-euler/multipath-tools.git
hy-euler
multipath-tools
multipath-tools
master

搜索帮助