From: Patrik Flykt Date: Fri, 7 Jun 2013 05:25:25 +0000 (+0300) Subject: client: Read D-Bus string type only if argument is 'Type' X-Git-Tag: upstream/1.24~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db6ec6b0d66beb54aed7573fe9b975631603a527;p=platform%2Fupstream%2Fconnman.git 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. --- diff --git a/client/agent.c b/client/agent.c index afd265b..16d1928 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); }