mirror of
https://github.com/espressif/openthread.git
synced 2026-11-10 00:11:20 +00:00
This commit adds defensive bounds and length checks across the simulation radio platform and virtual-time event handling: - Fix `ProcessNodeIdFilter()` to iterate node IDs starting from `1` instead of `0` (preventing underflow in `FilterContainsId(0)`), validate parsed `allow`/`deny` node IDs before narrowing to `uint16_t`, and guard `FilterContainsId()` and `AddNodeIdToFilter()` with `IsNodeIdValid()`. - Initialize `senderNodeId`, drop zero-length UDP datagrams cleanly in `utilsReceiveFromSocket()`, and validate received and transmitted frame lengths in `platformRadioProcess()`, `platformRadioReceive()`, `RadioComputeCrc()`, `RadioTransmit()`, `RadioSendMessage()`, and `RadioSendSchedTx()`. - Add `IsChannelValid()` and guard `sChannelMaxTransmitPower` indexing, power calibration lookup, and null `aPower` in `otPlatRadioGetTransmitPower()`. - Validate `Event` header and `mDataLength` bounds in virtual-time simulation, failing fast with `DieNow(OT_EXIT_FAILURE)` in `otSimSendEvent()` and `receiveEvent()`, and guarding `platformUartSendVirtual()` and `otPlatOtnsStatus()`.