]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/rwmmap.c
Merge remote branch 'origin/mdb.master'
[openldap] / servers / slapd / overlays / rwmmap.c
index 61e507ff4f914ad7abb69f715a999cf318732e90..d3b4d01aac108a4f7f6608d19360c42030206bbd 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2010 The OpenLDAP Foundation.
+ * Copyright 1999-2012 The OpenLDAP Foundation.
  * Portions Copyright 1999-2003 Howard Chu.
  * Portions Copyright 2000-2003 Pierangelo Masarati.
  * All rights reserved.
@@ -209,7 +209,7 @@ rwm_map_attrnames(
        }
 
        assert( i > 0 || x > 0 );
-       *anp = op->o_tmpalloc( ( i + x + 1 )* sizeof( AttributeName ),
+       *anp = op->o_tmpcalloc( ( i + x + 1 ), sizeof( AttributeName ),
                op->o_tmpmemctx );
        if ( *anp == NULL ) {
                return LDAP_NO_MEMORY;
@@ -462,7 +462,9 @@ map_attr_value(
                                return -1;
                        }
 
-               } else if ( ad->ad_type->sat_equality->smr_usage & SLAP_MR_MUTATION_NORMALIZER ) {
+               } else if ( ad->ad_type->sat_equality &&
+                       ( ad->ad_type->sat_equality->smr_usage & SLAP_MR_MUTATION_NORMALIZER ) )
+               {
                        if ( ad->ad_type->sat_equality->smr_normalize(
                                (SLAP_MR_DENORMALIZE|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX),
                                NULL, NULL, value, &vtmp, memctx ) )
@@ -541,9 +543,12 @@ rwm_int_filter_map_rewrite(
                return LDAP_OTHER;
        }
 
+#if 0
+       /* ITS#6814: give the caller a chance to use undefined filters */
        if ( f->f_choice & SLAPD_FILTER_UNDEFINED ) {
                goto computed;
        }
+#endif
 
        switch ( f->f_choice & SLAPD_FILTER_MASK ) {
        case LDAP_FILTER_EQUALITY: