small change

This commit is contained in:
MichaelDvP
2020-05-26 11:42:28 +02:00
parent 91f8afd3b1
commit 55c60365f6
3 changed files with 3 additions and 2 deletions

View File

@@ -268,7 +268,7 @@ void RxService::add(uint8_t * data, uint8_t length) {
uint8_t message_length;
// work out depending on the type where the data message block starts
if (data[2] < 0xF0) {
if (data[2] < 0xF0 || length < 6) {
// EMS 1.0
type_id = data[2];
message_data = data + 4; // message block starts at 5th byte