summaryrefslogtreecommitdiff
path: root/android/hidhost.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@gmail.com>2014-01-24 00:05:37 +0100
committerSzymon Janc <szymon.janc@gmail.com>2014-01-24 00:05:37 +0100
commitf1c4969ff86100e7be828ef582ea1afa1747daa0 (patch)
treef8bf7107b2a44005b07f1fd13cfa3188c4143695 /android/hidhost.c
parent72d2c6c415a483dd5a658756e83fc7bb28576f35 (diff)
downloadbluez-f1c4969ff86100e7be828ef582ea1afa1747daa0.tar.gz
android/hidhost: Verify set info command correctness
Although it is not implemented verify command correctness for IPC completeness.
Diffstat (limited to 'android/hidhost.c')
-rw-r--r--android/hidhost.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/android/hidhost.c b/android/hidhost.c
index c01c56373..37b28a6fc 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -895,6 +895,14 @@ failed:
static void bt_hid_info(const void *buf, uint16_t len)
{
+ const struct hal_cmd_hidhost_set_info *cmd = buf;
+
+ if (len != sizeof(*cmd) + cmd->descr_len) {
+ error("Invalid hid set info size (%u bytes), terminating", len);
+ raise(SIGTERM);
+ return;
+ }
+
/* Data from hal_cmd_hidhost_set_info is usefull only when we create
* UHID device. Once device is created all the transactions will be
* done through the fd. There is no way to use this information