]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10396 lmdb: fix mdb_cursor_del0 with multiple DUPSORT cursors
authorHoward Chu <hyc@openldap.org>
Mon, 6 Oct 2025 15:49:25 +0000 (16:49 +0100)
committerHoward Chu <hyc@openldap.org>
Mon, 6 Oct 2025 15:52:32 +0000 (16:52 +0100)
Use the correct stack index when adjusting other cursors pointing to
the affected page and the DB has a subDB. Broken in ITS#8406.

libraries/liblmdb/mdb.c

index 7a52945c3b0551ec9de5bd435d27fa5b5b1fe4de..73892c16eaf8f2aaa02e443523d911c10571c4a3 100644 (file)
@@ -8608,7 +8608,7 @@ mdb_cursor_del0(MDB_cursor *mc)
                                                goto fail;
                                }
                                if (m3->mc_xcursor && !(m3->mc_flags & C_EOF)) {
-                                       MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]);
+                                       MDB_node *node = NODEPTR(m3->mc_pg[mc->mc_top], m3->mc_ki[mc->mc_top]);
                                        /* If this node has dupdata, it may need to be reinited
                                         * because its data has moved.
                                         * If the xcursor was not initd it must be reinited.