-
Notifications
You must be signed in to change notification settings - Fork 617
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
generator: fix message length table overflow #344
Conversation
@@ -681,11 +676,12 @@ MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg, | |||
status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD; | |||
} | |||
#ifdef MAVLINK_CHECK_MESSAGE_LENGTH | |||
if (rxmsg->len != MAVLINK_MESSAGE_LENGTH(rxmsg->msgid)) | |||
if (rxmsg->len < mavlink_min_message_length(rxmsg) || | |||
rxmsg->len > mavlink_max_message_length(rxmsg)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a feeling one of these bounds checks is missing a >= or <=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know 🤔.
3ff976b
to
bbefc9a
Compare
@OXINARF do you need any other changes? |
@julianoes It should be squashed. And my comment regarding the formatting still applies (given we aren't fixing it here, it's better to not make it worse). |
Since MAVLink 2 we can have message IDs > 256 and we should probably look up the message length in the mavlink_msg_entry dict instead.
f1ee362
to
4e5107d
Compare
Ok, I squashed it to one commit and made the |
so... spaces wins? |
@magicrub I'm very much in favor of spaces but I'm not a maintainer here, so I don't think it should be up to me. 😄 |
I'm on team SPACES |
Anything else needed here? As said the tab vs. spaces discussion should not interfere with this bugfix in my opinion. |
Bump 🥺. |
I'm not too fussed by the whitespace, merging, thanks! |
Includes at least these two bugfixes: ArduPilot/pymavlink#343 ArduPilot/pymavlink#344
Includes at least these two bugfixes: ArduPilot/pymavlink#343 ArduPilot/pymavlink#344
Since MAVLink 2 we can have message IDs > 256 and we should probably look up the message length in the mavlink_msg_entry dict instead.
Fixes #145.