From: Adam Moore <adam.mo...@savantsystems.com>

Properly access Agent provided SSID as an array of bytes and recurse
where needed.

[Patrik: Fixed patch]
---
 src/agent-connman.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/agent-connman.c b/src/agent-connman.c
index 8440451..2d714b5 100644
--- a/src/agent-connman.c
+++ b/src/agent-connman.c
@@ -140,18 +140,21 @@ static void request_input_passphrase_reply(DBusMessage 
*reply, void *user_data)
                        dbus_message_iter_get_basic(&value, &name);
                        name_len = strlen(name);
                } else if (g_str_equal(key, "SSID")) {
+                       DBusMessageIter array_iter;
+
                        dbus_message_iter_next(&entry);
                        if (dbus_message_iter_get_arg_type(&entry)
                                                        != DBUS_TYPE_VARIANT)
                                break;
                        dbus_message_iter_recurse(&entry, &value);
                        if (dbus_message_iter_get_arg_type(&value)
-                                                       != DBUS_TYPE_VARIANT)
+                                                       != DBUS_TYPE_ARRAY)
                                break;
-                       if (dbus_message_iter_get_element_type(&value)
-                                                       != DBUS_TYPE_VARIANT)
+                       dbus_message_iter_recurse(&value, &array_iter);
+                       if (dbus_message_iter_get_arg_type(&array_iter)
+                                                       != DBUS_TYPE_BYTE)
                                break;
-                       dbus_message_iter_get_fixed_array(&value, &name,
+                       dbus_message_iter_get_fixed_array(&array_iter, &name,
                                                        &name_len);
                }
                dbus_message_iter_next(&dict);
-- 
2.1.4

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to