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 <makosoft@googlemail.com>.

Ref: https://bugs.gentoo.org/show_bug.cgi?id=398097
This commit is contained in:
Arun Raghavan 2012-05-11 17:32:20 +05:30
parent 7bb8442c11
commit ec316b04ac

View file

@ -753,7 +753,7 @@ int pa_bluetooth_transport_parse_property(pa_bluetooth_transport *t, DBusMessage
case DBUS_TYPE_BOOLEAN: { case DBUS_TYPE_BOOLEAN: {
pa_bool_t *value; dbus_bool_t value;
dbus_message_iter_get_basic(&variant_i, &value); dbus_message_iter_get_basic(&variant_i, &value);
if (pa_streq(key, "NREC")) if (pa_streq(key, "NREC"))
@ -1144,9 +1144,11 @@ static DBusMessage *endpoint_set_configuration(DBusConnection *conn, DBusMessage
goto fail; goto fail;
dbus_message_iter_get_basic(&value, &dev_path); dbus_message_iter_get_basic(&value, &dev_path);
} else if (strcasecmp(key, "NREC") == 0) { } else if (strcasecmp(key, "NREC") == 0) {
dbus_bool_t tmp_boolean;
if (var != DBUS_TYPE_BOOLEAN) if (var != DBUS_TYPE_BOOLEAN)
goto fail; 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) { } else if (strcasecmp(key, "Configuration") == 0) {
DBusMessageIter array; DBusMessageIter array;
if (var != DBUS_TYPE_ARRAY) if (var != DBUS_TYPE_ARRAY)