From 2a2d6cc93ed2320ecfea2bc49530e2dc83ad2719 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 13 Feb 2002 09:26:25 +0000 Subject: [PATCH] Add embedded NUL checks, fix last commit --- servers/slapd/dn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index c88b5e07c3..f871e38ce7 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -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 ) { -- 2.39.5