mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 22:05:47 +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();
|
conn = virGetConnectSecret();
|
||||||
|
if (!conn)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (virSecretGetSecretString(conn,
|
if (virSecretGetSecretString(conn,
|
||||||
&authdef->seclookupdef,
|
&authdef->seclookupdef,
|
||||||
secrettype,
|
secrettype,
|
||||||
|
Loading…
Reference in New Issue
Block a user