]> git.sur5r.net Git - openldap/commitdiff
fix size limit count (ITS#4181)
authorPierangelo Masarati <ando@openldap.org>
Thu, 17 Nov 2005 18:55:47 +0000 (18:55 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 17 Nov 2005 18:55:47 +0000 (18:55 +0000)
servers/slapd/back-sql/search.c

index dcd349ffa71750c2b7ef62c2c4bd7711b1dc6470..2fe00acb2c6ffbcedccde806ba178bdac33f725a 100644 (file)
@@ -2305,6 +2305,11 @@ backsql_search( Operation *op, SlapReply *rs )
 
                if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE )
                {
+                       if ( --op->ors_slimit == -1 ) {
+                               rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
+                               goto send_results;
+                       }
+
                        rs->sr_attrs = op->ors_attrs;
                        rs->sr_operational_attrs = NULL;
                        rs->sr_entry = e;
@@ -2334,10 +2339,6 @@ next_entry:;
                }
 
 next_entry2:;
-               if ( --op->ors_slimit == -1 ) {
-                       rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
-                       goto send_results;
-               }
        }
 
 end_of_search:;