Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve HID report parsing and safety checks #219

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

rygwdn
Copy link
Contributor

@rygwdn rygwdn commented Feb 2, 2025

Fix for #218 and possibly #133

  • Add report length validation in get_report_value()
  • Enhance report ID handling in extract_report_values()
  • Reset bit offset when changing report ID in parser
  • Add bounds checking to prevent potential buffer overruns

- Add report length validation in get_report_value()
- Enhance report ID handling in extract_report_values()
- Reset bit offset when changing report ID in parser
- Add bounds checking to prevent potential buffer overruns
@rygwdn rygwdn force-pushed the fix-multiple-report-ids branch from dba5a85 to 32305f1 Compare February 2, 2025 03:15
@hrvach
Copy link
Owner

hrvach commented Feb 3, 2025

Thank you for this, great catch! I was assuming the setting offset_in_bits to 0 between top-level collections would be enough, but seem to have forgotten about the possibility of new report IDs being introduced. Let me do some testing and pull this in.

@hrvach hrvach merged commit 9c793d4 into hrvach:main Feb 6, 2025
@rygwdn rygwdn deleted the fix-multiple-report-ids branch February 7, 2025 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants