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

AP_AIS: fix multi part message decoding #29195

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

IamPete1
Copy link
Member

This bug meant we never re-assembled multi part messages correctly. Tested with the simulator.

@IamPete1 IamPete1 requested a review from peterbarker January 30, 2025 18:22
@IamPete1 IamPete1 force-pushed the AIS_multi_part branch 3 times, most recently from 5b68e96 to 9cd01d3 Compare January 30, 2025 18:37
@peterbarker
Copy link
Contributor

Needs a rebase...

@IamPete1
Copy link
Member Author

IamPete1 commented Feb 1, 2025

Needs a rebase...

Done, kinda reassuring that the compiler could see the bug you found once it was possible to hit it.

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Tested locally inserting corruption.

uint8_t msg_parts[_incoming.num - 1];

// We have the last part, need to find preceding fragments
const uint8_t parts = _incoming.num - 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be an integer underflow problem here; _incoming.num is coming off the wire, and nothing is checking if it is zero or not.

This is pre-existing.

@IamPete1 IamPete1 merged commit f6a6e35 into ArduPilot:master Feb 3, 2025
100 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