neard: Fix reading State message
authorNicolas Fella <nicolas.fella@gmx.de>
Wed, 23 Feb 2022 21:56:17 +0000 (22:56 +0100)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:53 +0000 (14:55 +0530)
dbus_message_iter_recurse only makese sense for container types, this is a string.

Fixes: https://github.com/bluez/bluez/issues/300
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
plugins/neard.c

index 8427761..d5a5428 100755 (executable)
@@ -580,14 +580,12 @@ static int process_message(DBusMessage *msg, struct oob_params *remote)
                        if (process_nokia_com_bt(data, size, remote))
                                goto error;
                } else if (strcasecmp(key, "State") == 0) {
-                       DBusMessageIter array;
                        const char *state;
 
                        if (dbus_message_iter_get_arg_type(&value) !=
                                        DBUS_TYPE_STRING)
                                goto error;
 
-                       dbus_message_iter_recurse(&value, &array);
                        dbus_message_iter_get_basic(&value, &state);
 
                        remote->power_state = process_state(state);