fix ITS#4450?

This commit is contained in:
Pierangelo Masarati 2006-04-03 00:34:35 +00:00
parent 070c9d9f07
commit 8823f5cc87

View File

@ -899,25 +899,20 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
int len = srv->lud_dn ? strlen( srv->lud_dn ) : 0;
for ( lp = origreq; lp; ) {
if ( lp->lr_conn == lc ) {
if ( len == lp->lr_dn.bv_len ) {
if ( len && strncmp( srv->lud_dn, lp->lr_dn.bv_val,
len ))
if ( len == lp->lr_dn.bv_len
&& len
&& strncmp( srv->lud_dn, lp->lr_dn.bv_val, len ) == 0 )
{
/* FIXME: if different DNs are requested
* for the same connection, this causes
* an endless loop, because lp is never
* changed */
continue;
}
looped = 1;
break;
}
}
if ( lp == origreq )
if ( lp == origreq ) {
lp = lp->lr_child;
else
} else {
lp = lr->lr_refnext;
}
}
if ( looped ) {
ldap_free_urllist( srv );
srv = NULL;