/* we need this to know if back-ldap returned any result */
lb.lb_lc = lc;
+ sc2.sc_next = sc->sc_next;
sc2.sc_private = &lb;
sc2.sc_response = ldap_chain_cb_response;
op->o_callback = &sc2;
case LDAP_SUCCESS:
case LDAP_REFERRAL:
+ sr_err = rs->sr_err;
/* slapd-ldap sent response */
if ( !op->o_abandon && lb.lb_status != LDAP_CH_RES ) {
/* FIXME: should we send response? */
ber_bvarray_add( &si->si_authz, &bv );
} else {
- int i;
- for ( i = 0; !BER_BVISNULL( &si->si_authz[ i ] ); i++ )
- ;
+ int i = 0;
+ if ( si->si_authz != NULL ) {
+ for ( ; !BER_BVISNULL( &si->si_authz[ i ] ); i++ )
+ ;
+ }
if ( i <= c->valx ) {
ber_bvarray_add( &si->si_authz, &bv );
ber_bvarray_add( &si->si_passthru, &bv );
} else {
- int i;
- for ( i = 0; !BER_BVISNULL( &si->si_passthru[ i ] ); i++ )
- ;
+ int i = 0;
+ if ( si->si_passthru != NULL ) {
+ for ( ; !BER_BVISNULL( &si->si_passthru[ i ] ); i++ )
+ ;
+ }
if ( i <= c->valx ) {
ber_bvarray_add( &si->si_passthru, &bv );