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

Prevent possible buffer overrun in MSPv2 message parsing #9780

Merged
merged 1 commit into from May 10, 2020

Conversation

etracer65
Copy link
Member

The MSPv2 parsing was missing a check (present in v1 code) to prevent a possible buffer overrun if the payload exceeded the buffer size. The buffer overrun is not likely in normal circumstances since 192 bytes are allocated, but could be triggered through message corruption with invalid size data.

Also some code formatting cleanup.

The MSPv2 parsing was missing a check (present in v1) to prevent a possible buffer overrun if the payload exceeded the buffer size.

Also some code formatting cleanup.
@etracer65 etracer65 added this to the 4.2 milestone May 8, 2020
@etracer65
Copy link
Member Author

Note that this is not related to the "64 byte USB bug". Just something I found while tracing through the code.

@mikeller mikeller merged commit 1885e2c into betaflight:master May 10, 2020
@mikeller mikeller modified the milestones: 4.2, 4.1.7 May 28, 2020
@etracer65 etracer65 deleted the mspv2_buffer_overrun_check branch June 2, 2020 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants