don't auto-detect DCE form; assert the UTF-8 charlen is legal

This commit is contained in:
Pierangelo Masarati 2002-01-16 09:57:20 +00:00
parent 913c321a7e
commit 6c5be3006d

View File

@ -648,7 +648,12 @@ ldap_str2dn( LDAP_CONST char *str, LDAPDN **dn, unsigned flags )
goto parsing_error; goto parsing_error;
} }
p++; p++;
/*
* actually we do not want to accept by default the DCE form,
* we do not want to auto-detect it
*/
#if 0
} else if ( LDAP_DN_LDAP( flags ) ) { } else if ( LDAP_DN_LDAP( flags ) ) {
/* /*
* if dn starts with '/' let's make it a DCE dn * if dn starts with '/' let's make it a DCE dn
@ -657,6 +662,7 @@ ldap_str2dn( LDAP_CONST char *str, LDAPDN **dn, unsigned flags )
flags |= LDAP_DN_FORMAT_DCE; flags |= LDAP_DN_FORMAT_DCE;
p++; p++;
} }
#endif
} }
for ( ; p[ 0 ]; p++ ) { for ( ; p[ 0 ]; p++ ) {
@ -1980,6 +1986,10 @@ strval2str( struct berval *val, char *str, unsigned flags, ber_len_t *len )
continue; continue;
} }
/*
* The length was checked in strval2strlen();
*/
assert( LDAP_UTF8_CHARLEN2( &val->bv_val[ s ], cl ) > 0 );
cl = LDAP_UTF8_CHARLEN( &val->bv_val[ s ] ); cl = LDAP_UTF8_CHARLEN( &val->bv_val[ s ] );
/* /*