diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-06-07 08:25:25 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-06-07 10:09:18 +0300 |
commit | db6ec6b0d66beb54aed7573fe9b975631603a527 (patch) | |
tree | 0a782a224668708cb308b5b1d8e012d13e3a4d6a /client | |
parent | a6aa682808efc88680bb6e5e90cf61e07c15454a (diff) | |
download | connman-db6ec6b0d66beb54aed7573fe9b975631603a527.tar.gz connman-db6ec6b0d66beb54aed7573fe9b975631603a527.tar.bz2 connman-db6ec6b0d66beb54aed7573fe9b975631603a527.zip |
client: Read D-Bus string type only if argument is 'Type'
A basic type was always read independent of the argument type which
on some systems lead to a crash and on others only to a warning
printout.
Diffstat (limited to 'client')
-rw-r--r-- | client/agent.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/agent.c b/client/agent.c index afd265bc..16d1928c 100644 --- a/client/agent.c +++ b/client/agent.c @@ -386,10 +386,11 @@ static DBusMessage *agent_request_input(DBusConnection *connection, dbus_message_iter_recurse(&field_entry, &field_value); - dbus_message_iter_get_basic(&field_value, &value); - - if (strcmp(argument, "Type") == 0) + if (strcmp(argument, "Type") == 0) { + dbus_message_iter_get_basic(&field_value, + &value); attr_type = g_strdup(value); + } dbus_message_iter_next(&dict_entry); } |