]> git.sur5r.net Git - openldap/commitdiff
ITS#7515 Reject conflicting page versions.
authorHallvard Furuseth <hallvard@openldap.org>
Sun, 7 Jul 2013 15:14:38 +0000 (17:14 +0200)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 7 Jul 2013 15:14:38 +0000 (17:14 +0200)
If mdb_page_touch() sees a page in txn's dirty_list, that
is the page version txn's cursors should have.  Fail if
the user may be seeing and depending on another version.

libraries/liblmdb/mdb.c

index 7647ea3e34cccde20fb239b46a0c4280a5dc8e4c..96ac9521f270152f9793792b820eadf4cc4116b3 100644 (file)
@@ -1560,9 +1560,10 @@ mdb_page_touch(MDB_cursor *mc)
                if (dl[0].mid) {
                        unsigned x = mdb_mid2l_search(dl, pgno);
                        if (x <= dl[0].mid && dl[x].mid == pgno) {
-                               np = dl[x].mptr;
-                               if (mp != np)
-                                       mc->mc_pg[mc->mc_top] = np;
+                               if (mp != dl[x].mptr) { /* bad cursor? */
+                                       mc->mc_flags &= ~(C_INITIALIZED|C_EOF);
+                                       return MDB_CORRUPTED;
+                               }
                                return 0;
                        }
                }