5 Star 0 Fork 8

src-openEuler/fence-virt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bz1766993-fence_virtd-1-fix-segfault-no-domains.patch 940 Bytes
一键复制 编辑 原始数据 按行查看 历史
jiangxinyu 提交于 2022-02-28 16:25 . Fix fence_virtd.service stop failed
From 36367a99eb803a7941f6cbfd6086e7a71bf91e21 Mon Sep 17 00:00:00 2001
From: Andrew Price <anprice@redhat.com>
Date: Tue, 29 Oct 2019 11:27:06 +0000
Subject: [PATCH] fence_virtd: Fix segfault in vl_get when no domains are found
If virConnectListAllDomains() returns 0 on every iteration, the loop
will end with a vl == NULL and the pointer dereference in the qsort()
call will result in a segfault. Check for NULL on completion of the loop
to guard against that.
Signed-off-by: Andrew Price <anprice@redhat.com>
---
server/virt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/server/virt.c b/server/virt.c
index 9710791..ed08e0c 100644
--- a/server/virt.c
+++ b/server/virt.c
@@ -128,6 +128,9 @@ virt_list_t *vl_get(virConnectPtr *vp, int vp_count, int my_id)
_free_dom_list(dom_list, ret);
}
+ /* No domains found */
+ if (!vl)
+ return NULL;
/* We have all the locally running domains & states now */
/* Sort */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/fence-virt.git
git@gitee.com:src-openeuler/fence-virt.git
src-openeuler
fence-virt
fence-virt
master

搜索帮助