From 41778cc59bff5db84b122201293ea12118c538b2 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Mon, 17 Oct 2022 16:49:13 +0200 Subject: [PATCH] Code review comments --- src/crypto/CHIPCryptoPALPSA.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/crypto/CHIPCryptoPALPSA.cpp b/src/crypto/CHIPCryptoPALPSA.cpp index 6bd424a427bab5..ded8dd186ac5b4 100644 --- a/src/crypto/CHIPCryptoPALPSA.cpp +++ b/src/crypto/CHIPCryptoPALPSA.cpp @@ -782,8 +782,7 @@ P256Keypair::~P256Keypair() CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) const { - VerifyOrReturnError(out_csr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(csr_length > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(isBufferNonEmpty(out_csr, csr_length), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(mInitialized, CHIP_ERROR_WELL_UNINITIALIZED); MutableByteSpan csr(out_csr, csr_length);