From 67ddc87e68add0c34e8ab043de2fa552de8d9c7c Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 22 Aug 2000 22:34:37 +0000 Subject: [PATCH] Fix substring any filters --- servers/slapd/schema_init.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 19058dce9a..6c14e783c3 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -1127,8 +1127,10 @@ int caseExactIA5SubstringsFilter( value = sa->sa_any[i]; - for(j=0; jsa_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; jsa_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, -- 2.39.5