From: Kurt Zeilenga Date: Thu, 3 Jan 2002 20:03:27 +0000 (+0000) Subject: All empty IA5 and Printable strings, but not Directory strings. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~310 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f5ab06738b9a209ecd9519c98706959d22b5b60e;p=openldap All empty IA5 and Printable strings, but not Directory strings. --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 8f781d3338..968dc443a3 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -1939,8 +1939,6 @@ printableStringValidate( { ber_len_t i; - if( !val->bv_len ) return LDAP_INVALID_SYNTAX; - for(i=0; i < val->bv_len; i++) { if( !SLAP_PRINTABLE(val->bv_val[i]) ) { return LDAP_INVALID_SYNTAX; @@ -1957,8 +1955,6 @@ printablesStringValidate( { ber_len_t i; - if( !val->bv_len ) return LDAP_INVALID_SYNTAX; - for(i=0; i < val->bv_len; i++) { if( !SLAP_PRINTABLES(val->bv_val[i]) ) { return LDAP_INVALID_SYNTAX; @@ -1975,10 +1971,10 @@ IA5StringValidate( { ber_len_t i; - if( !val->bv_len ) return LDAP_INVALID_SYNTAX; - for(i=0; i < val->bv_len; i++) { - if( !isascii(val->bv_val[i]) ) return LDAP_INVALID_SYNTAX; + if( !LDAP_ASCII(val->bv_val[i]) ) { + return LDAP_INVALID_SYNTAX; + } } return LDAP_SUCCESS; @@ -1999,10 +1995,6 @@ IA5StringNormalize( p++; } - if( *p == '\0' ) { - return LDAP_INVALID_SYNTAX; - } - normalized->bv_val = ch_strdup( p ); p = q = normalized->bv_val; @@ -2019,12 +2011,9 @@ IA5StringNormalize( } } - assert( normalized->bv_val < p ); + assert( normalized->bv_val <= p ); assert( q <= p ); - /* cannot start with a space */ - assert( !ASCII_SPACE(*normalized->bv_val) ); - /* * If the string ended in space, backup the pointer one * position. One is enough because the above loop collapsed @@ -2035,9 +2024,6 @@ IA5StringNormalize( --q; } - /* cannot end with a space */ - assert( !ASCII_SPACE( q[-1] ) ); - /* null terminate */ *q = '\0';