From: Kurt Zeilenga Date: Wed, 13 Feb 2002 04:20:11 +0000 (+0000) Subject: Quick (and expensive) fix to detect DNs with embedded NULs X-Git-Tag: OPENLDAP_REL_ENG_2_1_BP~30 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b2d948f0e5c3ac5ab8111d52940bc43e63b1d2f2;p=openldap Quick (and expensive) fix to detect DNs with embedded NULs --- diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index a70d5df292..b776e18e30 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -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 ) {