mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
fix septentrio: ensure the crc check does not read past the buffer size
in case the input data is invalid.
This commit is contained in:
parent
d13692ca46
commit
ac74a02d7c
@ -243,7 +243,7 @@ bool Decoder::done() const
|
||||
|
||||
bool Decoder::can_parse() const
|
||||
{
|
||||
return done()
|
||||
return done() && _message.header.length <= sizeof(_message)
|
||||
&& _message.header.crc == buffer_crc16(reinterpret_cast<const uint8_t *>(&_message) + 4, _message.header.length - 4);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user