Skip to content

Commit

Permalink
Fix incorrect loop condition in HasValidEventPathForEndpointAndCluste…
Browse files Browse the repository at this point in the history
…r. (project-chip#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 project-chip#28981
  • Loading branch information
bzbarsky-apple authored Sep 1, 2023
1 parent f8668c7 commit 5deb59b
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 5deb59b

Please sign in to comment.