Skip to content

Avoid out-of-bounds errors caused by invalid endpoint number#3336

Closed
ldube wants to merge 1 commit intohathach:masterfrom
ldube:btiny
Closed

Avoid out-of-bounds errors caused by invalid endpoint number#3336
ldube wants to merge 1 commit intohathach:masterfrom
ldube:btiny

Conversation

@ldube
Copy link
Contributor

@ldube ldube commented Nov 8, 2025

Describe the PR
The endpoint number is used to index arrays of size CFG_TUD_ENDPPOINT_MAX. This PR adds a bounds check before the index is used.

Additional context
Maybe #3281 will be fixed

codescene-delta-analysis[bot]

This comment was marked as outdated.

@HiFiPhile
Copy link
Collaborator

Thank you but I don't think it's necessary.

CFG_TUD_ENDPPOINT_MAX is already checked in usbd_edpt_open and usbd_edpt_iso_alloc, #3281 is due to erroneous test adapter sending invalid event which can only happens in stack overflow or RAM corruption.

@ldube ldube closed this Nov 15, 2025
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