From d2fb515e4d714af4fe4554efcb0624db12b35955 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Thu, 11 Apr 2013 11:37:25 +0200 Subject: [PATCH] qemu: fix crash in qemuOpen If the path part of connection URI is not present, cfg is used unitialized. https://bugzilla.redhat.com/show_bug.cgi?id=950855 (cherry picked from commit 74bff2509080912ea8abf1de8fd95fa2412b659a) --- 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 32b05229fc..b19f4976f6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1016,6 +1016,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, goto cleanup; } + cfg = virQEMUDriverGetConfig(qemu_driver); if (conn->uri->path == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, _("no QEMU URI path given, try %s"), @@ -1023,7 +1024,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, goto cleanup; } - cfg = virQEMUDriverGetConfig(qemu_driver); if (cfg->privileged) { if (STRNEQ(conn->uri->path, "/system") && STRNEQ(conn->uri->path, "/session")) { -- 2.47.3