mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Avoid a possible NULL pointer deref in qemuDomainGetTLSObjects
Passing a NULL value for the argument secAlias to the function qemuDomainGetTLSObjects would cause a segmentation fault in libvirtd. Changed code to check before dereferencing a NULL secAlias. Signed-off-by: Ashish Mittal <ashmit602@gmail.com>
This commit is contained in:
parent
0c81518b2d
commit
a74a16320b
@ -1638,12 +1638,14 @@ qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps,
|
||||
if (qemuBuildSecretInfoProps(secinfo, secProps) < 0)
|
||||
return -1;
|
||||
|
||||
if (!(*secAlias = qemuDomainGetSecretAESAlias(srcAlias, false)))
|
||||
if (!secAlias ||
|
||||
!(*secAlias = qemuDomainGetSecretAESAlias(srcAlias, false)))
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (qemuBuildTLSx509BackendProps(tlsCertdir, tlsListen, tlsVerify,
|
||||
*secAlias, qemuCaps, tlsProps) < 0)
|
||||
secAlias ? *secAlias : NULL, qemuCaps,
|
||||
tlsProps) < 0)
|
||||
return -1;
|
||||
|
||||
if (!(*tlsAlias = qemuAliasTLSObjFromSrcAlias(srcAlias)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user