Skip to content

Commit

Permalink
Fix minimal mDNS ResolvedNodeData::mAddress overflow (#12672)
Browse files Browse the repository at this point in the history
  • Loading branch information
kghost authored and pull[bot] committed Dec 5, 2023
1 parent ed947f5 commit 1320888
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/dnssd/Resolver_ImplMinimalMdns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ void PacketDataReporter::OnOperationalIPAddress(const chip::Inet::IPAddress & ad
// This code assumes that all entries in the mDNS packet relate to the
// same entity. This may not be correct if multiple servers are reported
// (if multi-admin decides to use unique ports for every ecosystem).
if (mNodeData.mNumIPs >= ResolvedNodeData::kMaxIPAddresses)
{
return;
}
mNodeData.mAddress[mNodeData.mNumIPs++] = addr;
mNodeData.mInterfaceId = mInterfaceId;
mHasIP = true;
Expand Down

0 comments on commit 1320888

Please sign in to comment.