From: Pierangelo Masarati Date: Wed, 16 Jan 2002 09:57:20 +0000 (+0000) Subject: don't auto-detect DCE form; assert the UTF-8 charlen is legal X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~113 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6c5be3006d4ec954085be52e06b77bdc2bbad3b5;p=openldap don't auto-detect DCE form; assert the UTF-8 charlen is legal --- diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index c22ea552bd..c0f0273327 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -648,7 +648,12 @@ ldap_str2dn( LDAP_CONST char *str, LDAPDN **dn, unsigned flags ) goto parsing_error; } p++; - + + /* + * actually we do not want to accept by default the DCE form, + * we do not want to auto-detect it + */ +#if 0 } else if ( LDAP_DN_LDAP( flags ) ) { /* * if dn starts with '/' let's make it a DCE dn @@ -657,6 +662,7 @@ ldap_str2dn( LDAP_CONST char *str, LDAPDN **dn, unsigned flags ) flags |= LDAP_DN_FORMAT_DCE; p++; } +#endif } for ( ; p[ 0 ]; p++ ) { @@ -1980,6 +1986,10 @@ strval2str( struct berval *val, char *str, unsigned flags, ber_len_t *len ) continue; } + /* + * The length was checked in strval2strlen(); + */ + assert( LDAP_UTF8_CHARLEN2( &val->bv_val[ s ], cl ) > 0 ); cl = LDAP_UTF8_CHARLEN( &val->bv_val[ s ] ); /*