]> git.sur5r.net Git - openldap/commitdiff
value_normalize can change the length of value. Fixed
authorKurt Zeilenga <kurt@openldap.org>
Wed, 2 Jun 1999 20:29:35 +0000 (20:29 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 2 Jun 1999 20:29:35 +0000 (20:29 +0000)
use in index_add_value(), but should modify value_normalize
to use a struct berval * instead of a char* pointer...

servers/slapd/back-bdb2/index.c
servers/slapd/back-ldbm/index.c

index 63731f666ed09076c9353fa66b19c2ef9c8f0e1e..87b0a7318ac6596c30bdccebf8a56338b1b1a56f 100644 (file)
@@ -271,6 +271,9 @@ bdb2i_index_add_values(
 
                value_normalize( val, syntax );
 
+               /* value_normalize could change the length of val */
+               len = strlen( val );
+
                /*
                 * equality index entry
                 */
index be528ed36494ceba2799aecf392354b3bc02d3e8..8561da7040243c23217d6501b4a9ca80eca9eb0c 100644 (file)
@@ -31,9 +31,8 @@ index_add_entry(
         * with index_add_values() call
         */
 
-       bv.bv_val = ch_strdup( e->e_dn );
+       bv.bv_val = ch_strdup( e->e_ndn );
        bv.bv_len = strlen( bv.bv_val );
-       (void) dn_normalize_case( bv.bv_val );
        bvals[0] = &bv;
        bvals[1] = NULL;
 
@@ -52,7 +51,7 @@ index_add_entry(
        }
 
        Debug( LDAP_DEBUG_TRACE, "<= index_add( %ld, \"%s\" ) 0\n", e->e_id,
-           e->e_dn, 0 );
+           e->e_ndn, 0 );
        return( 0 );
 }
 
@@ -279,6 +278,9 @@ index_add_values(
 
                value_normalize( val, syntax );
 
+               /* value_normalize could change the length of val */
+               len = strlen( val );
+
                /*
                 * equality index entry
                 */