Avoid data array overflow (#1142)

Occurs through packet collisions. Sometimes a wrong length is received.
This commit is contained in:
seeers
2018-06-16 13:32:10 +02:00
committed by Patrick Fallberg
parent f934d7c46f
commit a28b7036ca
+6
View File
@@ -155,6 +155,12 @@ bool _serialProcess()
_recPhase = 1;
_recPos = 0;
//Avoid _data[] overflow
if (_recLen >= MY_RS485_MAX_MESSAGE_LENGTH) {
_serialReset();
break;
}
//Check if we should process this message
//We reject the message if we are the sender
//We reject if we are not the receiver and message is not a broadcast