]> git.sur5r.net Git - openldap/commitdiff
ITS#8542 mdb_dbi_open(): Protect mainDB cursors
authorHallvard Furuseth <hallvard@openldap.org>
Tue, 13 Dec 2016 23:23:01 +0000 (00:23 +0100)
committerHallvard Furuseth <hallvard@openldap.org>
Thu, 15 Dec 2016 21:27:33 +0000 (22:27 +0100)
libraries/liblmdb/mdb.c

index f059fd6f5d3be3f6bd1d4bff1b2565b9c6e794ad..32349dffe987791b728c14d0da30fdfca410f414 100644 (file)
@@ -9724,7 +9724,8 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db
                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;
        }