diff --git a/src/utility/HCI.cpp b/src/utility/HCI.cpp index 233dd1a5..f158d035 100644 --- a/src/utility/HCI.cpp +++ b/src/utility/HCI.cpp @@ -112,6 +112,13 @@ void HCIClass::poll(unsigned long timeout) while (HCITransport.available()) { byte b = HCITransport.read(); + + if (_recvIndex >= sizeof(_recvBuffer)) { + _recvIndex = 0; + if (_debug) { + _debug->println("_recvBuffer overflow"); + } + } _recvBuffer[_recvIndex++] = b;