]> git.sur5r.net Git - openldap/commitdiff
Quick (and expensive) fix to detect DNs with embedded NULs
authorKurt Zeilenga <kurt@openldap.org>
Wed, 13 Feb 2002 04:20:11 +0000 (04:20 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 13 Feb 2002 04:20:11 +0000 (04:20 +0000)
servers/slapd/dn.c

index a70d5df29252675680b95b880b1aae67cfd68e2a..b776e18e302518d1807c9548d960d218bbf1a633 100644 (file)
@@ -470,6 +470,11 @@ dnPrettyNormal(
                pretty->bv_len = 0;
                normal->bv_len = 0;
 
+               /* 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 ) {