]> git.sur5r.net Git - openldap/commitdiff
ITS#7431 fix constraint_check_restrict segfault
authorJan Synacek <jsynacek@redhat.com>
Mon, 26 Nov 2012 21:49:14 +0000 (13:49 -0800)
committerHoward Chu <hyc@openldap.org>
Mon, 26 Nov 2012 21:49:53 +0000 (13:49 -0800)
servers/slapd/overlays/constraint.c

index ee8911bd4071d025673a187fc0171dae00b979d2..f2c645c609c04f4fc6c6040ca47b65ae2517da4d 100644 (file)
@@ -935,10 +935,6 @@ constraint_update( Operation *op, SlapReply *rs )
 
        /* Do we need to count attributes? */
        for(cp = c; cp; cp = cp->ap_next) {
-               if (cp->restrict_lud && constraint_check_restrict(op, cp, target_entry) == 0) {
-                       continue;
-               }
-
                if (cp->count != 0) {
                        if (rc != 0 || target_entry == NULL) {
                                Debug(LDAP_DEBUG_TRACE, 
@@ -950,6 +946,10 @@ constraint_update( Operation *op, SlapReply *rs )
                                goto mod_violation;
                        }
 
+                       if (cp->restrict_lud && constraint_check_restrict(op, cp, target_entry) == 0) {
+                               continue;
+                       }
+
                        is_v = constraint_check_count_violation(m, target_entry, cp);
 
                        Debug(LDAP_DEBUG_TRACE,