summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src
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:48:08 +0200
commite3bc77da41034b72110f3a6bf0fa9430f61f9b9e (patch)
tree87af8e1a27941649b41258390abf712999dd7309 /plugins/Dbx_mdbx/src
parentd5dcc702d4ccc59acbac3f67c50ad0f069ca96dc (diff)
Dbx_mdbx: fixes crash when user tries to compact a profile with password
(cherry picked from commit b6bbbb16e26ce924022d623572fce852e234ee16)
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-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);