[network-data] add nullptr check in Iterate() (#5359)

This commit is contained in:
Jonathan Hui
2020-08-07 12:26:29 -07:00
committed by GitHub
parent c112b9351d
commit 03bcb408f9
+5
View File
@@ -348,6 +348,11 @@ otError NetworkData::Iterate(Iterator &aIterator, uint16_t aRloc16, Config &aCon
{
const ServiceTlv *service = static_cast<const ServiceTlv *>(cur);
if (aConfig.mService == nullptr)
{
continue;
}
if (subCur->GetType() == NetworkDataTlv::kTypeServer)
{
const ServerTlv *server = static_cast<const ServerTlv *>(subCur);