From f1c4969ff86100e7be828ef582ea1afa1747daa0 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 24 Jan 2014 00:05:37 +0100 Subject: [PATCH] android/hidhost: Verify set info command correctness Although it is not implemented verify command correctness for IPC completeness. --- android/hidhost.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.47.3