From: Pierangelo Masarati Date: Sat, 2 Mar 2002 17:28:19 +0000 (+0000) Subject: backout previous change; validation has been added to dnNormalize functions X-Git-Tag: OPENLDAP_REL_ENG_2_MP~379 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=914d703714c1d35ea5da83f737bed5bc70835497;p=openldap backout previous change; validation has been added to dnNormalize functions --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index b1febd47c2..2a65e5f7e8 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -536,14 +536,10 @@ UTF8StringNormalize( /* All space is ASCII. All ASCII is 1 byte */ for ( ; p < val->bv_val + val->bv_len && ASCII_SPACE( p[ 0 ] ); p++ ); - normalized->bv_len = val->bv_len - (p - val->bv_val); - if ( normalized->bv_len == 0 ) { - return LDAP_INVALID_SYNTAX; - } - - ber_mem2bv( p, normalized->bv_len, 1, normalized ); - e = normalized->bv_val + normalized->bv_len; + ber_mem2bv( p, val->bv_len - (p - val->bv_val), 1, normalized ); + e = normalized->bv_val + val->bv_len - (p - val->bv_val); + assert( normalized->bv_len ); assert( normalized->bv_val ); p = q = normalized->bv_val;