make sure the DN is null-terminated before normalizing it

This commit is contained in:
Pierangelo Masarati 2003-02-06 19:15:14 +00:00
parent 1b499a7d7c
commit 9f28f12346

View File

@ -1664,11 +1664,16 @@ int slap_sasl_getdn( Connection *conn, char *id, int len,
/* All strings are in DN form now. Normalize if needed. */
if ( do_norm ) {
if ( is_dn != SET_U ) {
struct berval dntmp;
ber_dupbv( &dntmp, dn );
dn->bv_val = dntmp.bv_val;
}
rc = dnNormalize2( NULL, dn, &dn2 );
/* User DNs were constructed above and must be freed now */
if ( is_dn == SET_U )
ch_free( dn->bv_val );
ch_free( dn->bv_val );
if ( rc != LDAP_SUCCESS ) {
dn->bv_val = NULL;