arduino / arduino/ArduinoCore-sam
HID.sendReport - Stack overflow
- Dominant language
- HTML
- Stars
- 91
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/arduino/ArduinoCore-sam/blob/790ff2c852bf159787a9966bddee4d9f55352d15/libraries/HID/src/HID.cpp#L88
The length argument is unchecked and will cause a stack overflow if >63.
Allthough most HID messages are less than 63 bytes long, yet it is possible for HID reports to exceed this limit and occupy multiple USB interrupt frames. Sending such reports would crash the sketch.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at libraries/HID/src/HID.cpp:88 and trace how HID.sendReport uses its length argument. Reproduce the issue with a report longer than 63 bytes and inspect the existing HID tests or examples for report handling. Done means oversized reports no longer crash the sketch and the intended multi-frame behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100