Skip to content

Display and control your Android device

Fix UHID_OUTPUT message parsing

Romain Vimont3e40b2473772
diff --git a/app/src/device_msg.c b/app/src/device_msg.c
index 7621c040..2172d59b 100644
--- a/app/src/device_msg.c
+++ b/app/src/device_msg.c
@@ -53,7 +53,7 @@ sc_device_msg_deserialize(const uint8_t *buf, size_t len,
}
uint16_t id = sc_read16be(&buf[1]);
size_t size = sc_read16be(&buf[3]);
- if (size < len - 5) {
+ if (size > len - 5) {
return 0; // not available
}
uint8_t *data = malloc(size);