Diff between 72d2c6c415a483dd5a658756e83fc7bb28576f35 and f1c4969ff86100e7be828ef582ea1afa1747daa0

Changed Files

File Additions Deletions Status
android/hidhost.c +8 -0 modified

Full Patch

diff --git a/android/hidhost.c b/android/hidhost.c
index c01c563..37b28a6 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