From: Howard Chu Date: Tue, 6 Aug 2002 02:35:24 +0000 (+0000) Subject: ITS#1998 UTF8StringNormalize should accept all-space vals X-Git-Tag: NO_SLAP_OP_BLOCKS~1280 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=61731500d0f4b2a5e9c23993b886ccca20b50d85;p=openldap ITS#1998 UTF8StringNormalize should accept all-space vals --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 4e8ac815f8..29f2ae0b38 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -548,10 +548,10 @@ UTF8StringNormalize( /* All space is ASCII. All ASCII is 1 byte */ for ( ; p < val->bv_val + val->bv_len && ASCII_SPACE( p[ 0 ] ); p++ ); - ber_mem2bv( p, val->bv_len - (p - val->bv_val), 1, normalized ); - e = normalized->bv_val + val->bv_len - (p - val->bv_val); + normalized->bv_len = val->bv_len - (p - val->bv_val); + ber_mem2bv( p, normalized->bv_len, 1, normalized ); + e = normalized->bv_val + normalized->bv_len; - assert( normalized->bv_len ); assert( normalized->bv_val ); p = q = normalized->bv_val; @@ -575,7 +575,7 @@ UTF8StringNormalize( } } - assert( normalized->bv_val < p ); + assert( normalized->bv_val <= p ); assert( q+len <= p ); /* cannot start with a space */