*dbout = NULL;
- for( i=BDB_NDB; bdb->bi_databases[i]; i++ ) {
+ for( i=BDB_NDB; i < BDB_INDICES && bdb->bi_databases[i]; i++ ) {
if( !strcmp( bdb->bi_databases[i]->bdi_name, name) ) {
*dbout = bdb->bi_databases[i]->bdi_db;
return 0;
if (rc) return rc;
/* check again! may have been added by another thread */
- for( i=BDB_NDB; bdb->bi_databases[i]; i++ ) {
+ for( i=BDB_NDB; i < BDB_INDICES && bdb->bi_databases[i]; i++ ) {
if( !strcmp( bdb->bi_databases[i]->bdi_name, name) ) {
*dbout = bdb->bi_databases[i]->bdi_db;
LOCK_PUT( bdb->bi_dbenv, &lock);
return rc;
}
- bdb->bi_databases[i+1] = NULL;
bdb->bi_databases[i] = db;
bdb->bi_ndatabases = i+1;