client: Fix crash when setting advertising.discoverable on
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 10 May 2019 11:58:09 +0000 (14:58 +0300)
committerhimanshu <h.himanshu@samsung.com>
Tue, 11 Feb 2020 08:57:47 +0000 (14:27 +0530)
DBUS_TYPE_BOOLEAN expect a pointer to dbus_bool_t not bool.

Change-Id: I7eccad12814365dc88e26ff85ae0e79ee421ded9
Signed-off-by: himanshu <h.himanshu@samsung.com>
client/advertising.c

index 28c8fdc..926afd7 100644 (file)
@@ -420,8 +420,9 @@ static gboolean discoverable_exists(const GDBusPropertyTable *property,
 static gboolean get_discoverable(const GDBusPropertyTable *property,
                                        DBusMessageIter *iter, void *user_data)
 {
-       dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN,
-                                                       &ad.discoverable);
+       dbus_bool_t value = ad.discoverable;
+
+       dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &value);
 
        return TRUE;
 }