X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fschema_init.c;h=616d9703842915b381cccaf56eea1facf464339e;hb=6a9c44849c1c20b9d961de7a0b6585dcd059154a;hp=6f218dcf95e81ce2b2f22a6b67af561274bbf48b;hpb=da6d9eb0463255782f3fa70c61fd958d94c048cf;p=openldap diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 6f218dcf95..616d970384 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -2049,8 +2049,6 @@ IA5StringValidate( { ber_len_t i; - if( BER_BVISEMPTY( val ) ) return LDAP_INVALID_SYNTAX; - for(i=0; i < val->bv_len; i++) { if( !LDAP_ASCII(val->bv_val[i]) ) { return LDAP_INVALID_SYNTAX; @@ -2073,8 +2071,6 @@ IA5StringNormalize( int casefold = !SLAP_MR_ASSOCIATED( mr, slap_schema.si_mr_caseExactIA5Match ); - assert( !BER_BVISEMPTY( val ) ); - assert( SLAP_MR_IS_VALUE_OF_SYNTAX( use ) != 0 ); p = val->bv_val; @@ -2111,18 +2107,12 @@ IA5StringNormalize( * position. One is enough because the above loop collapsed * all whitespace to a single space. */ - if ( ASCII_SPACE( q[-1] ) ) --q; + if ( q > normalized->bv_val && ASCII_SPACE( q[-1] ) ) --q; /* null terminate */ *q = '\0'; normalized->bv_len = q - normalized->bv_val; - if( BER_BVISEMPTY( normalized ) ) { - normalized->bv_val = slap_sl_realloc( normalized->bv_val, 2, ctx ); - normalized->bv_val[0] = ' '; - normalized->bv_val[1] = '\0'; - normalized->bv_len = 1; - } return LDAP_SUCCESS; }