Blob Blame History Raw
From 98ec954cba5abf87f29cf5122825eb565b5bdf64 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Sat, 2 Nov 2013 00:01:32 +0100
Subject: [PATCH] detect_virtualization() returns NULL; pass empty string to
 dbus

---
 src/core/dbus-manager.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 7be5d13..6d16c2a 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -466,7 +466,7 @@ static int bus_manager_append_progress(DBusMessageIter *i, const char *property,
 
 static int bus_manager_append_virt(DBusMessageIter *i, const char *property, void *data) {
         Manager *m = data;
-        const char *id = "";
+        const char *id = NULL;
 
         assert(i);
         assert(property);
@@ -474,6 +474,8 @@ static int bus_manager_append_virt(DBusMessageIter *i, const char *property, voi
 
         detect_virtualization(&id);
 
+        if (!id)
+                id = "";
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &id))
                 return -ENOMEM;