mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00: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:
parent
b74fd210b3
commit
ed80ce426e
@ -971,6 +971,9 @@ qemuNbdkitProcessBuildCommandAuth(virStorageAuthDef *authdef,
|
||||
}
|
||||
|
||||
conn = virGetConnectSecret();
|
||||
if (!conn)
|
||||
return -1;
|
||||
|
||||
if (virSecretGetSecretString(conn,
|
||||
&authdef->seclookupdef,
|
||||
secrettype,
|
||||
|
Loading…
x
Reference in New Issue
Block a user