]> git.sur5r.net Git - openldap/commitdiff
ITS#8321 Fix mdb_cursor_set
authorHoward Chu <hyc@openldap.org>
Mon, 23 Nov 2015 18:30:24 +0000 (18:30 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 24 Nov 2015 15:59:52 +0000 (15:59 +0000)
Always reinit mc_pg[0] if cursor is not C_INITIALIZED
It might have a stale value when using nested txns

libraries/liblmdb/mdb.c

index 307cb4bf7fcb996170cf06eec7953bb7825ccae0..7b5e099534b824e5c628f5b2ddf7b978fa5ec00c 100644 (file)
@@ -5878,6 +5878,8 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data,
                        } else
                                return MDB_NOTFOUND;
                }
+       } else {
+               mc->mc_pg[0] = 0;
        }
 
        rc = mdb_page_search(mc, key, 0);