diff --git a/services/distributeddataservice/adapter/account/src/account_delegate_normal_impl.cpp b/services/distributeddataservice/adapter/account/src/account_delegate_normal_impl.cpp index c40dbf1979425fd2109ba401c34b5a29407be72c..d32ce2b45bf87262895455675a5bad531b4409f5 100644 --- a/services/distributeddataservice/adapter/account/src/account_delegate_normal_impl.cpp +++ b/services/distributeddataservice/adapter/account/src/account_delegate_normal_impl.cpp @@ -142,8 +142,8 @@ std::string AccountDelegateNormalImpl::Sha256AccountId(const std::string &plainT plain = atoll(plainText.substr(plainText.size() - int64MaxLen + 1, int64MaxLen - 1).c_str()); } - plain = htobe64(plain); - return Crypto::Sha256(static_cast(&plain), sizeof(plain), true); + auto plainVal = htobe64(plain); + return Crypto::Sha256(static_cast(&plainVal), sizeof(plainVal), true); } } // namespace DistributedKv } // namespace OHOS \ No newline at end of file