summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-07 21:46:32 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-05-07 21:46:32 +0200
commitb6bbbb16e26ce924022d623572fce852e234ee16 (patch)
treed094f00f69469e426c67808c9e4272ce49187b28
parent0a1f205c87aefcc941efd3b2464e5255b52b4ef1 (diff)
Dbx_mdbx: fixes crash when user tries to compact a profile with password
-rw-r--r--plugins/Dbx_mdbx/src/dbcrypt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Dbx_mdbx/src/dbcrypt.cpp b/plugins/Dbx_mdbx/src/dbcrypt.cpp
index 36fb76a978..ccd65aef7a 100644
--- a/plugins/Dbx_mdbx/src/dbcrypt.cpp
+++ b/plugins/Dbx_mdbx/src/dbcrypt.cpp
@@ -68,10 +68,12 @@ CRYPTO_PROVIDER* CDbxMDBX::SelectProvider()
int CDbxMDBX::InitCrypt()
{
- CRYPTO_PROVIDER *pProvider;
+ if (m_crypto != nullptr)
+ return 0;
txn_ptr_ro txn(m_txn_ro);
+ CRYPTO_PROVIDER *pProvider;
MDBX_val key = { DBKey_Crypto_Provider, sizeof(DBKey_Crypto_Provider) }, value;
if (mdbx_get(txn, m_dbCrypto, &key, &value) == MDBX_SUCCESS) {
pProvider = Crypto_GetProvider((const char*)value.iov_base);