mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-14 16:23:23 -05:00
Make sure mdb_stat() gets valid data
This commit is contained in:
parent
e7f6767ea8
commit
bcb67dd22f
1 changed files with 6 additions and 0 deletions
|
|
@ -7325,6 +7325,12 @@ int mdb_stat(MDB_txn *txn, MDB_dbi dbi, MDB_stat *arg)
|
|||
if (txn == NULL || arg == NULL || dbi >= txn->mt_numdbs)
|
||||
return EINVAL;
|
||||
|
||||
if (txn->mt_dbflags[dbi] & DB_STALE) {
|
||||
MDB_cursor mc;
|
||||
MDB_xcursor mx;
|
||||
/* Stale, must read the DB's root. cursor_init does it for us. */
|
||||
mdb_cursor_init(&mc, txn, dbi, &mx);
|
||||
}
|
||||
return mdb_stat0(txn->mt_env, &txn->mt_dbs[dbi], arg);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue