From a3f33dd20e71b9c94e94a0e1125fcee8d35fc70f Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Wed, 3 Oct 2012 18:08:56 +0200 Subject: [PATCH] Fix mdb_open() off-by-one error in maxdbs check --- libraries/libmdb/mdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 9e3e2ae..262919a 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -6548,7 +6548,7 @@ int mdb_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *dbi) } /* If no free slot and max hit, fail */ - if (!unused && txn->mt_numdbs >= txn->mt_env->me_maxdbs - 1) + if (!unused && txn->mt_numdbs >= txn->mt_env->me_maxdbs) return MDB_DBS_FULL; /* Find the DB info */