From 46935399d33e29962de887d2b3c9a7c48cc4a64d Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 18 Feb 2022 16:09:00 -0500 Subject: [PATCH] TLV test uses wrong size on strncmp (#15358) --- src/lib/core/tests/TestCHIPTLV.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/core/tests/TestCHIPTLV.cpp b/src/lib/core/tests/TestCHIPTLV.cpp index 3cc08001126467..82f84ee77c611c 100644 --- a/src/lib/core/tests/TestCHIPTLV.cpp +++ b/src/lib/core/tests/TestCHIPTLV.cpp @@ -2581,10 +2581,10 @@ void CheckCHIPTLVPutStringF(nlTestSuite * inSuite, void * inContext) err = reader.Next(); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = reader.GetString(valStr, 256); + err = reader.GetString(valStr, bufsize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, strncmp(valStr, strBuffer, 256) == 0); + NL_TEST_ASSERT(inSuite, strncmp(valStr, strBuffer, bufsize) == 0); } void CheckCHIPTLVPutStringSpan(nlTestSuite * inSuite, void * inContext) @@ -2629,10 +2629,10 @@ void CheckCHIPTLVPutStringSpan(nlTestSuite * inSuite, void * inContext) err = reader.Next(); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = reader.GetString(valStr, 256); + err = reader.GetString(valStr, bufsize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, strncmp(valStr, strBuffer, 256) == 0); + NL_TEST_ASSERT(inSuite, strncmp(valStr, strBuffer, bufsize) == 0); } }