]> git.sur5r.net Git - openldap/commitdiff
Fix substring any filters
authorKurt Zeilenga <kurt@openldap.org>
Tue, 22 Aug 2000 22:34:37 +0000 (22:34 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 22 Aug 2000 22:34:37 +0000 (22:34 +0000)
servers/slapd/schema_init.c

index 19058dce9acd5c9d4d22eac270d3adc8bb7a2b45..6c14e783c3ba0f1e9c64b462ea1068536beb618d 100644 (file)
@@ -1127,8 +1127,10 @@ int caseExactIA5SubstringsFilter(
 
                        value = sa->sa_any[i];
 
-                       for(j=0; j<sa->sa_any[i]->bv_len; j+= SLAP_INDEX_SUBSTR_STEP ) {
-
+                       for(j=0;
+                               j <= value->bv_len - SLAP_INDEX_SUBSTR_MAXLEN;
+                               j += SLAP_INDEX_SUBSTR_STEP )
+                       {
                                lutil_MD5Init( &MD5context );
                                if( prefix != NULL && prefix->bv_len > 0 ) {
                                        lutil_MD5Update( &MD5context,
@@ -1716,7 +1718,10 @@ int caseIgnoreIA5SubstringsFilter(
                        value = ber_bvdup( sa->sa_any[i] );
                        ldap_pvt_str2upper( value->bv_val );
 
-                       for(j=0; j<sa->sa_any[i]->bv_len; j+= SLAP_INDEX_SUBSTR_STEP ) {
+                       for(j=0;
+                               j <= value->bv_len - SLAP_INDEX_SUBSTR_MAXLEN;
+                               j += SLAP_INDEX_SUBSTR_STEP )
+                       {
                                lutil_MD5Init( &MD5context );
                                if( prefix != NULL && prefix->bv_len > 0 ) {
                                        lutil_MD5Update( &MD5context,