Repository navigation
hid: clamp report reads and survive a panicked command - #13
Merged
Merged
Conversation
hidapi on Windows adds one to a report read's byte count when the first byte is 0, so a full 91-byte Razer feature read comes back as 92. receive_feature_report sliced data[1..size] unclamped and panicked. receive_input_report already clamped; both now share report_payload. The panic poisoned the session lock. Every later command, list included, was then answered with id 0, which the app ignores, so each request timed out after 10s and the device could never be used. Bridge is a windowed app, so the panic message never reached the log either. Recover the lock, log the panic, and answer with the request's own id. Seen on a Razer Diamondback Chroma (1532:004c) on Windows 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #12 with the same commit rebased onto current main (no content change vs author's tip; fmt/clippy/test verified locally: 37+4 pass, fmt+clippy clean). Maintainer cannot push to the author's fork, so this branch carries the rebase instead.