Skip to content

Commit

Permalink
Fix incorrect loop condition in HasValidEventPathForEndpointAndCluste…
Browse files Browse the repository at this point in the history
…r. (#28989)

The test was backwards, so when CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE was
defined for the "wildcard event" case we always ended up treating the list of
events for the cluster as empty.

Fixes #28981
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Oct 11, 2023
1 parent 7f3cc61 commit 26ec83d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/InteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ static bool HasValidEventPathForEndpointAndCluster(EndpointId aEndpoint, const E
if (aEventPath.HasWildcardEventId())
{
#if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE
for (decltype(aCluster->eventCount) idx = 0; idx > aCluster->eventCount; ++idx)
for (decltype(aCluster->eventCount) idx = 0; idx < aCluster->eventCount; ++idx)
{
ConcreteEventPath path(aEndpoint, aCluster->clusterId, aCluster->eventList[idx]);
// If we get here, the path exists. We just have to do an ACL check for it.
Expand Down

0 comments on commit 26ec83d

Please sign in to comment.