From b6bbbb16e26ce924022d623572fce852e234ee16 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 7 May 2018 21:46:32 +0200 Subject: Dbx_mdbx: fixes crash when user tries to compact a profile with password --- plugins/Dbx_mdbx/src/dbcrypt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3