mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Fix mdb_cursor_count, reject uninit'd cursor
This commit is contained in:
parent
fcb0768e7d
commit
58e9c3add8
1 changed files with 3 additions and 0 deletions
|
|
@ -6989,6 +6989,9 @@ mdb_cursor_count(MDB_cursor *mc, size_t *countp)
|
|||
if (mc->mc_txn->mt_flags & MDB_TXN_ERROR)
|
||||
return MDB_BAD_TXN;
|
||||
|
||||
if (!(mc->mc_flags & C_INITIALIZED))
|
||||
return EINVAL;
|
||||
|
||||
leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
|
||||
if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) {
|
||||
*countp = 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue