From: Ján Tomko Date: Thu, 11 Apr 2013 09:37:25 +0000 (+0200) Subject: qemu: fix crash in qemuOpen X-Git-Tag: v1.0.5-rc1~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74bff2509080912ea8abf1de8fd95fa2412b659a;p=thirdparty%2Flibvirt.git 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 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2c0d7d1135..0d41e39d48 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1026,6 +1026,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"), @@ -1033,7 +1034,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")) {