diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index acc609a31dc82e..77653953a3c947 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -495,7 +495,7 @@ CHIP_ERROR CASESession::FindLocalNodeFromDestionationId(const ByteSpan & destina } // Try every IPK candidate we have for a match - for (size_t keyIdx = 0; keyIdx <= ipkKeySet.num_keys_used; ++keyIdx) + for (size_t keyIdx = 0; keyIdx < ipkKeySet.num_keys_used; ++keyIdx) { uint8_t candidateDestinationId[kSHA256_Hash_Length]; MutableByteSpan candidateDestinationIdSpan(candidateDestinationId);