diff options
author | mj-xmr <mjxmr@protonmail.com> | 2021-08-16 08:08:26 +0200 |
---|---|---|
committer | mj-xmr <mjxmr@protonmail.com> | 2021-09-09 08:18:21 +0200 |
commit | cf65e5b41b076cd0b03f89a375ef2631f0c0ee68 (patch) | |
tree | 8224fb89d6a57a40527199528150999b6ee32147 /src/blockchain_db | |
parent | Merge pull request #7902 (diff) | |
download | monero-cf65e5b41b076cd0b03f89a375ef2631f0c0ee68.tar.xz |
LMDB: protection against UB, by not calling virtual methods from destructor - v0.17
Diffstat (limited to 'src/blockchain_db')
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 4865ec952..bab3f7e42 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1268,11 +1268,11 @@ BlockchainLMDB::~BlockchainLMDB() // batch transaction shouldn't be active at this point. If it is, consider it aborted. if (m_batch_active) { - try { batch_abort(); } + try { BlockchainLMDB::batch_abort(); } catch (...) { /* ignore */ } } if (m_open) - close(); + BlockchainLMDB::close(); } BlockchainLMDB::BlockchainLMDB(bool batch_transactions): BlockchainDB() @@ -1569,9 +1569,9 @@ void BlockchainLMDB::close() if (m_batch_active) { LOG_PRINT_L3("close() first calling batch_abort() due to active batch transaction"); - batch_abort(); + BlockchainLMDB::batch_abort(); } - this->sync(); + BlockchainLMDB::sync(); m_tinfo.reset(); // FIXME: not yet thread safe!!! Use with care. @@ -1584,7 +1584,7 @@ void BlockchainLMDB::sync() LOG_PRINT_L3("BlockchainLMDB::" << __func__); check_open(); - if (is_read_only()) + if (BlockchainLMDB::is_read_only()) return; // Does nothing unless LMDB environment was opened with MDB_NOSYNC or in part |