From: Howard Chu Date: Tue, 19 Dec 2006 19:47:01 +0000 (+0000) Subject: Fix: don't modify original filter in filter_map_rewrite X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~337 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7d9361e49867ea470772626b10fea8e6126996dc;p=openldap Fix: don't modify original filter in filter_map_rewrite --- diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index dce3a95f73..ed30211df1 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -451,6 +451,7 @@ rwm_int_filter_map_rewrite( { int i; Filter *p; + AttributeDescription *ad; struct berval atmp, vtmp, *tmp; @@ -480,7 +481,8 @@ rwm_int_filter_map_rewrite( switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: - if ( map_attr_value( dc, &f->f_av_desc, &atmp, + ad = f->f_av_desc; + if ( map_attr_value( dc, &ad, &atmp, &f->f_av_value, &vtmp, RWM_MAP ) ) { goto computed; @@ -496,7 +498,8 @@ rwm_int_filter_map_rewrite( break; case LDAP_FILTER_GE: - if ( map_attr_value( dc, &f->f_av_desc, &atmp, + ad = f->f_av_desc; + if ( map_attr_value( dc, &ad, &atmp, &f->f_av_value, &vtmp, RWM_MAP ) ) { goto computed; @@ -512,7 +515,8 @@ rwm_int_filter_map_rewrite( break; case LDAP_FILTER_LE: - if ( map_attr_value( dc, &f->f_av_desc, &atmp, + ad = f->f_av_desc; + if ( map_attr_value( dc, &ad, &atmp, &f->f_av_value, &vtmp, RWM_MAP ) ) { goto computed; @@ -528,7 +532,8 @@ rwm_int_filter_map_rewrite( break; case LDAP_FILTER_APPROX: - if ( map_attr_value( dc, &f->f_av_desc, &atmp, + ad = f->f_av_desc; + if ( map_attr_value( dc, &ad, &atmp, &f->f_av_value, &vtmp, RWM_MAP ) ) { goto computed; @@ -544,7 +549,8 @@ rwm_int_filter_map_rewrite( break; case LDAP_FILTER_SUBSTRINGS: - if ( map_attr_value( dc, &f->f_sub_desc, &atmp, + ad = f->f_sub_desc; + if ( map_attr_value( dc, &ad, &atmp, NULL, NULL, RWM_MAP ) ) { goto computed; @@ -606,7 +612,8 @@ rwm_int_filter_map_rewrite( break; case LDAP_FILTER_PRESENT: - if ( map_attr_value( dc, &f->f_desc, &atmp, + ad = f->f_desc; + if ( map_attr_value( dc, &ad, &atmp, NULL, NULL, RWM_MAP ) ) { goto computed; @@ -652,7 +659,8 @@ rwm_int_filter_map_rewrite( case LDAP_FILTER_EXT: { if ( f->f_mr_desc ) { - if ( map_attr_value( dc, &f->f_mr_desc, &atmp, + ad = f->f_mr_desc; + if ( map_attr_value( dc, &ad, &atmp, &f->f_mr_value, &vtmp, RWM_MAP ) ) { goto computed;