if( mr && ( mr->smr_usage & SLAP_MR_DN_FOLD ) ) {
char *s = bv.bv_val;
- ber_str2bv( UTF8normalize( bv.bv_val ? &bv
- : &ava->la_value, LDAP_UTF8_CASEFOLD ),
- 0, 0, &bv );
+ if ( UTF8bvnormalize( &bv, &bv,
+ LDAP_UTF8_CASEFOLD ) == NULL ) {
+ return LDAP_INVALID_SYNTAX;
+ }
free( s );
}
}
if( sa->sa_initial.bv_val != NULL ) {
- ber_str2bv( UTF8normalize( &sa->sa_initial, casefold ), 0,
- 0, &nsa->sa_initial );
+ UTF8bvnormalize( &sa->sa_initial, &nsa->sa_initial, casefold );
if( nsa->sa_initial.bv_val == NULL ) {
goto err;
}
}
nsa->sa_any = (struct berval *)ch_malloc( (i + 1) * sizeof(struct berval) );
for( i=0; sa->sa_any[i].bv_val != NULL; i++ ) {
- ber_str2bv( UTF8normalize( &sa->sa_any[i], casefold ),
- 0, 0, &nsa->sa_any[i] );
+ UTF8bvnormalize( &sa->sa_any[i], &nsa->sa_any[i],
+ casefold );
if( nsa->sa_any[i].bv_val == NULL ) {
goto err;
}
}
if( sa->sa_final.bv_val != NULL ) {
- ber_str2bv( UTF8normalize( &sa->sa_final, casefold ), 0,
- 0, &nsa->sa_final );
+ UTF8bvnormalize( &sa->sa_final, &nsa->sa_final, casefold );
if( nsa->sa_final.bv_val == NULL ) {
goto err;
}
{
int match = 0;
SubstringsAssertion *sub = NULL;
- struct berval left;
+ struct berval left = { 0, NULL };
int i;
ber_len_t inlen=0;
char *nav;
casefold = strcmp( mr->smr_oid, caseExactSubstringsMatchOID )
? LDAP_UTF8_CASEFOLD : LDAP_UTF8_NOCASEFOLD;
- nav = UTF8normalize( value, casefold );
- if( nav == NULL ) {
+ if ( UTF8bvnormalize( value, &left, casefold ) == NULL ) {
match = 1;
goto done;
}
- left.bv_val = nav;
- left.bv_len = strlen( nav );
+ nav = left.bv_val;
sub = UTF8SubstringsassertionNormalize( assertedValue, casefold );
if( sub == NULL ) {