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

USBH: Recover from unexpected descriptor size #2852

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

GuavTek
Copy link
Contributor

@GuavTek GuavTek commented Oct 22, 2024

Describe the PR
Fixes the host getting stuck parsing a descriptor if the wTotalLength field is greater than the real descriptor size.

Additional context
I encountered this issue with the Exquis MIDI keyboard from Intuitive Instruments

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like device is off the specs, some is unfortunately. Thank you for your PR. I think it is best to move the (sanity) check to begining of the loop.

src/host/usbh.c Outdated Show resolved Hide resolved
src/tusb.c Outdated Show resolved Hide resolved
@GuavTek
Copy link
Contributor Author

GuavTek commented Nov 27, 2024

Ok, I have moved the sanity checks.
One of the CI checks started failing, but it doesn't look like it is related to my changes

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, thank you.

Ok, I have moved the sanity checks. One of the CI checks started failing, but it doesn't look like it is related to my changes

that is ok, I think PR is slightly out of date, merged from master should fix this.

@hathach hathach merged commit 3142927 into hathach:master Nov 28, 2024
106 checks passed
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