[operational-dataset] add additional TLV checks (#2159)

Credit to OSS-Fuzz.
This commit is contained in:
Jonathan Hui
2017-09-01 21:26:50 -07:00
committed by GitHub
parent ba586b5c36
commit b0cf1534bb
+2
View File
@@ -464,6 +464,7 @@ otError DatasetManager::Set(Coap::Header &aHeader, Message &aMessage, const Ip6:
// check mesh local prefix
if (Tlv::GetTlv(aMessage, Tlv::kMeshLocalPrefix, sizeof(meshLocalPrefix), meshLocalPrefix) == OT_ERROR_NONE &&
meshLocalPrefix.IsValid() &&
memcmp(meshLocalPrefix.GetMeshLocalPrefix(), netif.GetMle().GetMeshLocalPrefix(),
meshLocalPrefix.GetLength()))
{
@@ -472,6 +473,7 @@ otError DatasetManager::Set(Coap::Header &aHeader, Message &aMessage, const Ip6:
// check network master key
if (Tlv::GetTlv(aMessage, Tlv::kNetworkMasterKey, sizeof(masterKey), masterKey) == OT_ERROR_NONE &&
masterKey.IsValid() &&
memcmp(&masterKey.GetNetworkMasterKey(), &netif.GetKeyManager().GetMasterKey(), OT_MASTER_KEY_SIZE))
{
doesAffectConnectivity = true;