diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-04-30 19:04:22 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-05-04 06:53:37 +0200 |
commit | face9611093377e8502d91f2ff56f9319a56357c (patch) | |
tree | 1762fd3c121ec3e849c7cae40515e6e4a4f36bd9 /src | |
parent | fa05dddc42770809fdae4d9c35155f8117960019 (diff) |
refactor: Use only one temporary buffer in CreateObfuscateKey
Diffstat (limited to 'src')
-rw-r--r-- | src/dbwrapper.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index d7694108f5..3a1086bf4c 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -220,10 +220,9 @@ const unsigned int CDBWrapper::OBFUSCATE_KEY_NUM_BYTES = 8; */ std::vector<unsigned char> CDBWrapper::CreateObfuscateKey() const { - unsigned char buff[OBFUSCATE_KEY_NUM_BYTES]; - GetRandBytes(buff, OBFUSCATE_KEY_NUM_BYTES); - return std::vector<unsigned char>(&buff[0], &buff[OBFUSCATE_KEY_NUM_BYTES]); - + std::vector<uint8_t> ret(OBFUSCATE_KEY_NUM_BYTES); + GetRandBytes(ret.data(), OBFUSCATE_KEY_NUM_BYTES); + return ret; } bool CDBWrapper::IsEmpty() |