]> git.sur5r.net Git - openldap/commitdiff
ITS#5959 drop attrs with illegal values
authorHoward Chu <hyc@openldap.org>
Thu, 19 Feb 2009 02:05:28 +0000 (02:05 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 19 Feb 2009 02:05:28 +0000 (02:05 +0000)
servers/slapd/back-meta/search.c

index 27bac0e438b02466fbaa007577ffbebac740a4bd..4c52831e2326c4e8dccd25d25671712202b5a9dc 100644 (file)
@@ -2080,12 +2080,17 @@ remove_oc:;
 
                        attr->a_nvals = ch_malloc( ( last + 1 ) * sizeof( struct berval ) );
                        for ( i = 0; i<last; i++ ) {
-                               attr->a_desc->ad_type->sat_equality->smr_normalize(
+                               /* if normalizer fails, forget this attr */
+                               if ( attr->a_desc->ad_type->sat_equality->smr_normalize(
                                        SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
                                        attr->a_desc->ad_type->sat_syntax,
                                        attr->a_desc->ad_type->sat_equality,
                                        &attr->a_vals[i], &attr->a_nvals[i],
-                                       NULL );
+                                       NULL )) {
+                                       BER_BVZERO( &attr->a_nvals[i] );
+                                       attr_free( attr );
+                                       goto next_attr;
+                               }
                        }
                        BER_BVZERO( &attr->a_nvals[i] );