Skip to content
Snippets Groups Projects
Commit b82457ea authored by Andrew Tridgell's avatar Andrew Tridgell
Browse files

FollowMe: avoid integer underflow in mavlink txspace check

parent b36e4b41
No related branches found
No related tags found
No related merge requests found
...@@ -65,8 +65,8 @@ void simplegcs_send_heartbeat(mavlink_channel_t chan) { ...@@ -65,8 +65,8 @@ void simplegcs_send_heartbeat(mavlink_channel_t chan) {
bool simplegcs_try_send_statustext(mavlink_channel_t chan, const char *text, int len) { bool simplegcs_try_send_statustext(mavlink_channel_t chan, const char *text, int len) {
int payload_space = comm_get_txspace(chan) - MAVLINK_NUM_NON_PAYLOAD_BYTES; uint16_t txspace = comm_get_txspace(chan);
if (payload_space < MAVLINK_MSG_ID_STATUSTEXT_LEN) return false; if (payload_space < MAVLINK_MSG_ID_STATUSTEXT_LEN+MAVLINK_NUM_NON_PAYLOAD_BYTES) return false;
char statustext[50] = { 0 }; char statustext[50] = { 0 };
if (len < 50) { if (len < 50) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment