if ( x <= isc->scopes[0].mid && isc->scopes[x].mid == id ) {
if ( !isc->scopes[x].mval.mv_data ) {
/* This node is in scope, add parent chain to scope */
- int i = isc->sctmp[0].mid;
- for ( i = 1; i <= isc->sctmp[0].mid; i++ )
- mdb_id2l_insert( isc->scopes, &isc->sctmp[i] );
+ int i;
+ for ( i = 1; i <= isc->sctmp[0].mid; i++ ) {
+ rc = mdb_id2l_insert( isc->scopes, &isc->sctmp[i] );
+ assert(rc == 0);
+ }
/* check id again since inserts may have changed its position */
if ( isc->scopes[x].mid != id )
x = mdb_id2l_search( isc->scopes, id );
struct berval bv_alias = BER_BVC( "alias" );
AttributeAssertion aa_alias = ATTRIBUTEASSERTION_INIT;
Filter af;
- int first = 1;
aliases = stack; /* IDL of all aliases in the database */
curscop = aliases + MDB_IDL_DB_SIZE; /* Aliases in the current scope */
scopeok = 1;
} else {
i = mdb_idl_search( candidates, id );
- if ( candidates[i] == id )
+ if (i <= candidates[0] && candidates[i] == id )
scopeok = 1;
}
if ( scopeok )