mirror of https://github.com/ArduPilot/ardupilot
AP_RCProtocol: fixed underflow wrap in GHST
This commit is contained in:
parent
5a2f711d85
commit
4933ef3f2d
|
@ -177,6 +177,12 @@ void AP_RCProtocol_GHST::_process_byte(uint32_t timestamp_us, uint8_t byte)
|
|||
return;
|
||||
}
|
||||
|
||||
if (_frame.length < 2) {
|
||||
// invalid length, we subtract 2 below
|
||||
_frame_ofs = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// decode whatever we got and expect
|
||||
if (_frame_ofs == _frame.length + GHST_HEADER_LEN) {
|
||||
log_data(AP_RCProtocol::GHST, timestamp_us, (const uint8_t*)&_frame, _frame_ofs - GHST_HEADER_LEN);
|
||||
|
|
Loading…
Reference in New Issue