diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index 22b5e71adb3761..a76875e6b479a2 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -460,7 +460,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);