diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2013-03-15 09:04:19 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-03-18 15:00:44 +0200 |
commit | 89a38ee5e83feeb186678a87df08296e9611b413 (patch) | |
tree | af17aedc047fcb3a281ff5013f01b66612207085 /plugins | |
parent | e5e4fdc533ea997d6fdf0c550730786ec83707fa (diff) | |
download | connman-89a38ee5e83feeb186678a87df08296e9611b413.tar.gz connman-89a38ee5e83feeb186678a87df08296e9611b413.tar.bz2 connman-89a38ee5e83feeb186678a87df08296e9611b413.zip |
neard: RequestOOB() method sends empty dictionary
Reported by Ravikumar Veeramally
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/neard.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/neard.c b/plugins/neard.c index 85cf06b6..83561fed 100644 --- a/plugins/neard.c +++ b/plugins/neard.c @@ -172,6 +172,9 @@ static int parse_request_oob_params(DBusMessage *message, const char *key; int arg_type; + if (tlv_msg == NULL || length == NULL) + return -EINVAL; + dbus_message_iter_init(message, &iter); if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) @@ -182,9 +185,6 @@ static int parse_request_oob_params(DBusMessage *message, if (arg_type != DBUS_TYPE_DICT_ENTRY) return -EINVAL; - if (tlv_msg == NULL && length == NULL) - return 0; - while (arg_type != DBUS_TYPE_INVALID) { dbus_message_iter_recurse(&array, &dict_entry); if (dbus_message_iter_get_arg_type(&dict_entry) != @@ -254,9 +254,13 @@ out: static DBusMessage *request_oob_method(DBusConnection *dbus_conn, DBusMessage *message, void *user_data) { + DBusMessageIter iter; + DBG(""); - if (parse_request_oob_params(message, NULL, NULL) != 0) + dbus_message_iter_init(message, &iter); + + if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) return get_reply_on_error(message, EINVAL); return create_request_oob_reply(message); |