[libvirt PATCH] qemu_nbdkit: fix possible null dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_nbdkit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_nbdkit.c b/src/qemu/qemu_nbdkit.c
index 66b09cd240..17819ca992 100644
--- a/src/qemu/qemu_nbdkit.c
+++ b/src/qemu/qemu_nbdkit.c
@@ -971,6 +971,9 @@ qemuNbdkitProcessBuildCommandAuth(virStorageAuthDef *authdef,
     }
 
     conn = virGetConnectSecret();
+    if (!conn)
+        return -1;
+
     if (virSecretGetSecretString(conn,
                                  &authdef->seclookupdef,
                                  secrettype,
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux