mirror of
https://github.com/espressif/openthread.git
synced 2026-08-17 16:09:51 +00:00
[mle] add array bound check to avoid overflow in HandleDataRequest() (#8002)
This commit is contained in:
@@ -2882,7 +2882,10 @@ void MleRouter::HandleDataRequest(RxInfo &aRxInfo)
|
||||
OT_FALL_THROUGH;
|
||||
|
||||
case kErrorNotFound:
|
||||
tlvs[numTlvs++] = Tlv::kActiveDataset;
|
||||
if (numTlvs < sizeof(tlvs))
|
||||
{
|
||||
tlvs[numTlvs++] = Tlv::kActiveDataset;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -2901,7 +2904,10 @@ void MleRouter::HandleDataRequest(RxInfo &aRxInfo)
|
||||
OT_FALL_THROUGH;
|
||||
|
||||
case kErrorNotFound:
|
||||
tlvs[numTlvs++] = Tlv::kPendingDataset;
|
||||
if (numTlvs < sizeof(tlvs))
|
||||
{
|
||||
tlvs[numTlvs++] = Tlv::kPendingDataset;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user