From b2c4a3be6a4603d9d540f92a2ac352360f12755c Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 17 Nov 2005 18:55:47 +0000 Subject: [PATCH] fix size limit count (ITS#4181) --- servers/slapd/back-sql/search.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index dcd349ffa7..2fe00acb2c 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -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:;