summaryrefslogtreecommitdiff
path: root/android/hidhost.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@gmail.com>2013-12-30 23:56:20 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2013-12-31 11:34:32 +0200
commit47e30d43c56818c272b09abc15436039918078b8 (patch)
tree853974084241fd91c9baf2f9e73a3ba5028dbf28 /android/hidhost.c
parent33c2a480a8bdeaf077d77bdc43bc660015b3edbe (diff)
downloadbluez-47e30d43c56818c272b09abc15436039918078b8.tar.gz
android/hidhost: Move set_report parameter check to daemon
HAL library is to be as simple as possible and parameters values should be verified by daemon for robustness anyway. Move this check to daemon.
Diffstat (limited to 'android/hidhost.c')
-rw-r--r--android/hidhost.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/android/hidhost.c b/android/hidhost.c
index 1cf85b1e1..aed9899da 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -1064,6 +1064,16 @@ static void bt_hid_set_report(const void *buf, uint16_t len)
return;
}
+ switch (cmd->type) {
+ case HAL_HIDHOST_INPUT_REPORT:
+ case HAL_HIDHOST_OUTPUT_REPORT:
+ case HAL_HIDHOST_FEATURE_REPORT:
+ break;
+ default:
+ status = HAL_STATUS_INVALID;
+ goto failed;
+ }
+
android2bdaddr(&cmd->bdaddr, &dst);
l = g_slist_find_custom(devices, &dst, device_cmp);