Browse Source

Ticket 328 - make sure all internal search filters are properly escaped

Fix description: In addition to de8fd7d0e596e4de885b4dda6bf5329469880c45,
val of LDAP_SUBSTRING_ANY also needs to be reset to "struct slapi_filter
*f" if the part of the filter is excaped.
Noriko Hosoi 13 years ago
parent
commit
3e02250964
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ldap/servers/slapd/filter.c

+ 1 - 1
ldap/servers/slapd/filter.c

@@ -525,12 +525,12 @@ get_substring_filter(
 
 		case LDAP_SUBSTRING_ANY:
 			LDAPDebug( LDAP_DEBUG_FILTER, "  ANY\n", 0, 0, 0 );
-			charray_add( &f->f_sub_any, val );
 			eval = (char*)slapi_escape_filter_value( val, -1);
 			if(eval){
 				slapi_ch_free_string(&val);
 				val = eval;
 			}
+			charray_add( &f->f_sub_any, val );
 			*fstr = slapi_ch_realloc( *fstr, strlen( *fstr ) +
 			    strlen( val ) + 2 );
 			strcat( *fstr, "*" );