mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-17 05:24:19 +01:00
Fix UHID_OUTPUT message parsing
The bounds check was incorrect. Fixes #6415 <https://github.com/Genymobile/scrcpy/issues/6415>
This commit is contained in:
@@ -53,7 +53,7 @@ sc_device_msg_deserialize(const uint8_t *buf, size_t len,
|
|||||||
}
|
}
|
||||||
uint16_t id = sc_read16be(&buf[1]);
|
uint16_t id = sc_read16be(&buf[1]);
|
||||||
size_t size = sc_read16be(&buf[3]);
|
size_t size = sc_read16be(&buf[3]);
|
||||||
if (size < len - 5) {
|
if (size > len - 5) {
|
||||||
return 0; // not available
|
return 0; // not available
|
||||||
}
|
}
|
||||||
uint8_t *data = malloc(size);
|
uint8_t *data = malloc(size);
|
||||||
|
|||||||
Reference in New Issue
Block a user