fix crash due to NULL _sendBuffer

This commit is contained in:
etrinh 2020-07-09 22:22:16 +02:00
parent 96884f768e
commit 6f8cde49b4

View File

@ -245,7 +245,7 @@ void TpUartDataLinkLayer::loop()
//Destination Address + payload available
_xorSum ^= rxByte;
//check if echo
if (!((buffer[0] ^ _sendBuffer[0]) & ~0x20) && !memcmp(buffer + _convert + 1, _sendBuffer + 1, 5))
if (_sendBuffer != NULL && (!((buffer[0] ^ _sendBuffer[0]) & ~0x20) && !memcmp(buffer + _convert + 1, _sendBuffer + 1, 5)))
{ //ignore repeated bit of control byte
_isEcho = true;
}