mirror of
https://github.com/espressif/openthread.git
synced 2026-07-09 13:50:28 +00:00
prevent RxBuffer from overflowing (#843)
This commit is contained in:
@@ -117,8 +117,12 @@ void Uart::ReceiveTask(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
break;
|
||||
|
||||
default:
|
||||
Output(reinterpret_cast<const char *>(aBuf), 1);
|
||||
mRxBuffer[mRxLength++] = static_cast<char>(*aBuf);
|
||||
if (mRxLength < kRxBufferSize)
|
||||
{
|
||||
Output(reinterpret_cast<const char *>(aBuf), 1);
|
||||
mRxBuffer[mRxLength++] = static_cast<char>(*aBuf);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user