]> git.sur5r.net Git - openldap/commitdiff
Add embedded NUL checks, fix last commit
authorKurt Zeilenga <kurt@openldap.org>
Wed, 13 Feb 2002 09:26:25 +0000 (09:26 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 13 Feb 2002 09:26:25 +0000 (09:26 +0000)
servers/slapd/dn.c

index c88b5e07c3fca6b852f1792a0fe68ac52229cbf7..f871e38ce7526289fbd467303ca77840cbff3e0e 100644 (file)
@@ -117,7 +117,7 @@ dnValidate(
        }
 
        /* FIXME: str2dn should take a bv and handle this */
-       if( strlen( val->bv_val ) != val->bv_len ) {
+       if( strlen( in->bv_val ) != in->bv_len ) {
                return LDAP_INVALID_SYNTAX;
        }
 
@@ -424,6 +424,11 @@ dnPretty2(
                LDAPDN          *dn = NULL;
                int             rc;
 
+               /* FIXME: str2dn should take a bv and handle this */
+               if( strlen( val->bv_val ) != val->bv_len ) {
+                       return LDAP_INVALID_SYNTAX;
+               }
+
                /* FIXME: should be liberal in what we accept */
                rc = ldap_str2dn( val->bv_val, &dn, LDAP_DN_FORMAT_LDAP );
                if ( rc != LDAP_SUCCESS ) {