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:
Beat Küng
2025-06-11 14:35:59 +02:00
committed by Alexander Lerach
parent d13692ca46
commit ac74a02d7c
+1 -1
View File
@@ -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);
}