diff --git a/services/distributeddataservice/service/crypto/src/crypto_manager.cpp b/services/distributeddataservice/service/crypto/src/crypto_manager.cpp index e278c678fc1e6628d2c02639d6ced2393483deea..da532fa9f0e94dd882a63dff6a5eab9bbf20a6ea 100644 --- a/services/distributeddataservice/service/crypto/src/crypto_manager.cpp +++ b/services/distributeddataservice/service/crypto/src/crypto_manager.cpp @@ -262,7 +262,7 @@ std::vector CryptoManager::Encrypt(const std::vector &key, int } std::vector encryptedKey(cipherText.data, cipherText.data + cipherText.size); - (void)memset_s(cipherBuf, sizeof(cipherBuf), 0, sizeof(cipherBuf)); + std::fill(cipherBuf, cipherBuf + sizeof(cipherBuf), 0); return encryptedKey; } @@ -363,7 +363,7 @@ bool CryptoManager::Decrypt(std::vector &source, std::vector & } key.assign(plainKeyBlob.data, plainKeyBlob.data + plainKeyBlob.size); - (void)memset_s(plainBuf, sizeof(plainBuf), 0, sizeof(plainBuf)); + std::fill(plainBuf, plainBuf + sizeof(plainBuf), 0); return true; }