From ca97abb7f3d9c11cf03943581c157082fc0c04cc Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sat, 10 Dec 2016 09:16:17 +0100 Subject: [PATCH] mdbx: backport - mdb_dbi_open(): Protect mainDB cursors (ITS#8542). Change-Id: I5bdd3727eddc16a518c4b88534a3e7253e9789fd --- mdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mdb.c b/mdb.c index 1611e7fe..d520f5bf 100644 --- a/mdb.c +++ b/mdb.c @@ -9874,7 +9874,8 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned flags, MDB_dbi *dbi) memset(&dummy, 0, sizeof(dummy)); dummy.md_root = P_INVALID; dummy.md_flags = flags & PERSISTENT_FLAGS; - rc = mdb_cursor_put(&mc, &key, &data, F_SUBDATA); + WITH_CURSOR_TRACKING(mc, + rc = mdb_cursor_put(&mc, &key, &data, F_SUBDATA)); dbflag |= DB_DIRTY; }