Bug 1766995

Summary: fence_virtd: fix segfault in vl_get when no domains are found (RHEL7)
Product: Red Hat Enterprise Linux 7 Reporter: Oyvind Albrigtsen <oalbrigt>
Component: fence-virtAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.8CC: cluster-maint, cluster-qe, mjuricek, rmccabe
Target Milestone: rc   
Target Release: 7.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fence-virt-0.3.2-16.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1766993 Environment:
Last Closed: 2020-09-29 19:16:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1766993    
Bug Blocks:    

Description Oyvind Albrigtsen 2019-10-30 12:47:50 UTC
+++ This bug was initially created as a clone of Bug #1766993 +++

Description of problem:
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, so we need to check for NULL on completion of the loop to guard against that.

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Start fence_virtd with no domains present
2.
3.

Actual results:
Segfaults.

Expected results:
Doesnt segfault.

Additional info:
https://github.com/ClusterLabs/fence-virt/pull/17

Comment 7 errata-xmlrpc 2020-09-29 19:16:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (fence-virt bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3852