summaryrefslogtreecommitdiffstats
path: root/import-layers/meta-virtualization/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch
blob: 3cf9e83925a644cdedb7aa8d51d14055ad76812f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 74bff2509080912ea8abf1de8fd95fa2412b659a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Thu, 11 Apr 2013 11:37:25 +0200
Subject: [PATCH] qemu: fix crash in qemuOpen

commit 74bff2509080912ea8abf1de8fd95fa2412b659a from upsteam
git://libvirt.org/libvirt.git

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 files changed, 1 insertions(+), 1 deletions(-)

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
@@ -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")) {
-- 
1.7.1

OpenPOWER on IntegriCloud