]> git.sur5r.net Git - openldap/commitdiff
don't auto-detect DCE form; assert the UTF-8 charlen is legal
authorPierangelo Masarati <ando@openldap.org>
Wed, 16 Jan 2002 09:57:20 +0000 (09:57 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 16 Jan 2002 09:57:20 +0000 (09:57 +0000)
libraries/libldap/getdn.c

index c22ea552bd4f04ee066825dc139a878d22999158..c0f0273327838173f892832d53be7f0025d99c23 100644 (file)
@@ -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 ] );
                
                /*