mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 22:34:12 +08:00
mdbx: fix null-deref in an ASAN-enabled build while opening DB with MDBX_RDONLY.
Fixes https://github.com/erthink/libmdbx/issues/95 Change-Id: I1c000d3a456897f73367a590ef9fbda8ae90391c
This commit is contained in:
parent
9b94e45e25
commit
17d7d48281
@ -5771,6 +5771,9 @@ static void mdbx_txn_valgrind(MDBX_env *env, MDBX_txn *txn) {
|
|||||||
/* inside write-txn */
|
/* inside write-txn */
|
||||||
MDBX_meta *head = mdbx_meta_head(env);
|
MDBX_meta *head = mdbx_meta_head(env);
|
||||||
last = head->mm_geo.next;
|
last = head->mm_geo.next;
|
||||||
|
} else if (env->me_flags & MDBX_RDONLY) {
|
||||||
|
/* read-only mode, no write-txn, no wlock mutex */
|
||||||
|
last = NUM_METAS;
|
||||||
} else if (mdbx_txn_lock(env, true) == MDBX_SUCCESS) {
|
} else if (mdbx_txn_lock(env, true) == MDBX_SUCCESS) {
|
||||||
/* no write-txn */
|
/* no write-txn */
|
||||||
last = NUM_METAS;
|
last = NUM_METAS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user