From b2d948f0e5c3ac5ab8111d52940bc43e63b1d2f2 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 13 Feb 2002 04:20:11 +0000 Subject: [PATCH] Quick (and expensive) fix to detect DNs with embedded NULs --- servers/slapd/dn.c | 5 +++++ 1 file changed, 5 insertions(+) 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 ) { -- 2.39.5