[libvirt] [PATCH] qemu: fix crash in qemuOpen

Ján Tomko jtomko at redhat.com
Thu Apr 11 09:42:28 UTC 2013


If the path part of connection URI is not present, cfg is used
unitialized.

https://bugzilla.redhat.com/show_bug.cgi?id=950855
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2c0d7d1..0d41e39 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1025,16 +1025,16 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
                            _("qemu state driver is not active"));
             goto cleanup;
         }
 
+        cfg = virQEMUDriverGetConfig(qemu_driver);
         if (conn->uri->path == NULL) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("no QEMU URI path given, try %s"),
                            cfg->uri);
             goto cleanup;
         }
 
-        cfg = virQEMUDriverGetConfig(qemu_driver);
         if (cfg->privileged) {
             if (STRNEQ(conn->uri->path, "/system") &&
                 STRNEQ(conn->uri->path, "/session")) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-- 
1.8.1.5




More information about the libvir-list mailing list