summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2013-03-15 07:04:19 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-18 13:00:44 (GMT)
commit89a38ee5e83feeb186678a87df08296e9611b413 (patch)
treeaf17aedc047fcb3a281ff5013f01b66612207085 /plugins
parente5e4fdc533ea997d6fdf0c550730786ec83707fa (diff)
downloadconnman-89a38ee5e83feeb186678a87df08296e9611b413.zip
connman-89a38ee5e83feeb186678a87df08296e9611b413.tar.gz
connman-89a38ee5e83feeb186678a87df08296e9611b413.tar.bz2
neard: RequestOOB() method sends empty dictionary
Reported by Ravikumar Veeramally
Diffstat (limited to 'plugins')
-rw-r--r--plugins/neard.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/neard.c b/plugins/neard.c
index 85cf06b..83561fe 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);