mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-10 03:14:13 +08:00
mdbx: backport - fix FIRST_DUP/LAST_DUP cursor bounds check (ITS#8722).
This commit is contained in:
parent
ecbc0b9c12
commit
70042069eb
6
mdb.c
6
mdb.c
@ -6673,6 +6673,11 @@ fetchm:
|
|||||||
rc = MDB_INCOMPATIBLE;
|
rc = MDB_INCOMPATIBLE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (mc->mc_ki[mc->mc_top] >= NUMKEYS(mc->mc_pg[mc->mc_top])) {
|
||||||
|
mc->mc_ki[mc->mc_top] = NUMKEYS(mc->mc_pg[mc->mc_top]);
|
||||||
|
rc = MDB_NOTFOUND;
|
||||||
|
break;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
MDB_node *leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
|
MDB_node *leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
|
||||||
if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) {
|
if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) {
|
||||||
@ -7365,6 +7370,7 @@ mdb_cursor_del(MDB_cursor *mc, unsigned flags)
|
|||||||
if (!(m2->mc_flags & C_INITIALIZED)) continue;
|
if (!(m2->mc_flags & C_INITIALIZED)) continue;
|
||||||
if (m2->mc_pg[mc->mc_top] == mp) {
|
if (m2->mc_pg[mc->mc_top] == mp) {
|
||||||
MDB_node *n2 = leaf;
|
MDB_node *n2 = leaf;
|
||||||
|
if (m2->mc_ki[mc->mc_top] >= NUMKEYS(mp)) continue;
|
||||||
if (m2->mc_ki[mc->mc_top] != mc->mc_ki[mc->mc_top]) {
|
if (m2->mc_ki[mc->mc_top] != mc->mc_ki[mc->mc_top]) {
|
||||||
n2 = NODEPTR(mp, m2->mc_ki[mc->mc_top]);
|
n2 = NODEPTR(mp, m2->mc_ki[mc->mc_top]);
|
||||||
if (n2->mn_flags & F_SUBDATA) continue;
|
if (n2->mn_flags & F_SUBDATA) continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user