From ec316b04acb9b3f0a79f7e5d322674f3fa241338 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Fri, 11 May 2012 17:32:20 +0530 Subject: [PATCH] bluetooth: Fix crash due to usage of pa_bool_t instead of dbus_bool_t pa_bool_t and dbus_bool_t cannot be used interchangably since their size might (and do) vary. This caused a crash on some systems which was reported and root caused by: Aidan Thornton . Ref: https://bugs.gentoo.org/show_bug.cgi?id=398097 --- src/modules/bluetooth/bluetooth-util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c index 3f39a91c..b7865028 100644 --- a/src/modules/bluetooth/bluetooth-util.c +++ b/src/modules/bluetooth/bluetooth-util.c @@ -753,7 +753,7 @@ int pa_bluetooth_transport_parse_property(pa_bluetooth_transport *t, DBusMessage case DBUS_TYPE_BOOLEAN: { - pa_bool_t *value; + dbus_bool_t value; dbus_message_iter_get_basic(&variant_i, &value); if (pa_streq(key, "NREC")) @@ -1144,9 +1144,11 @@ static DBusMessage *endpoint_set_configuration(DBusConnection *conn, DBusMessage goto fail; dbus_message_iter_get_basic(&value, &dev_path); } else if (strcasecmp(key, "NREC") == 0) { + dbus_bool_t tmp_boolean; if (var != DBUS_TYPE_BOOLEAN) goto fail; - dbus_message_iter_get_basic(&value, &nrec); + dbus_message_iter_get_basic(&value, &tmp_boolean); + nrec = tmp_boolean; } else if (strcasecmp(key, "Configuration") == 0) { DBusMessageIter array; if (var != DBUS_TYPE_ARRAY) -- 2.39.2