mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
qemu_nbdkit: fix possible null dereference
Function virGetConnectSecret() can return NULL so we need to check it since in virSecretGetSecretString() it gets dereferenced. Reported-by: coverity Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
@@ -971,6 +971,9 @@ qemuNbdkitProcessBuildCommandAuth(virStorageAuthDef *authdef,
|
||||
}
|
||||
|
||||
conn = virGetConnectSecret();
|
||||
if (!conn)
|
||||
return -1;
|
||||
|
||||
if (virSecretGetSecretString(conn,
|
||||
&authdef->seclookupdef,
|
||||
secrettype,
|
||||
|
||||
Reference in New Issue
Block a user