[network-data] avoid buffer overflow in HandleCommissioningSet() (#4583)

Reject Commissioner Dataset TLVs with extended TLV length.
This commit is contained in:
Jonathan Hui
2020-02-21 11:17:05 -08:00
parent ea09b6e064
commit 167d616bc2
+1 -1
View File
@@ -206,7 +206,7 @@ void Leader::HandleCommissioningSet(Coap::Message &aMessage, const Ip6::MessageI
{
MeshCoP::Tlv::Type type;
VerifyOrExit((cur + 1) <= end && cur->GetNext() <= end);
VerifyOrExit(((cur + 1) <= end) && !cur->IsExtended() && (cur->GetNext() <= end));
type = cur->GetType();