代码拉取完成,页面将自动刷新
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 */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。