From 9826599834f6f8497f0249fca395e07eda733bd3 Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Thu, 19 Feb 2009 01:28:24 +0000
Subject: [PATCH] Final bits for ITS#5927

---
 servers/slapd/overlays/pcache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c
index f3cc1df54d..ad35eaef60 100644
--- a/servers/slapd/overlays/pcache.c
+++ b/servers/slapd/overlays/pcache.c
@@ -1976,7 +1976,7 @@ pcache_op_cleanup( Operation *op, SlapReply *rs ) {
 		Entry *e;
 
 		/* don't return more entries than requested by the client */
-		if ( si->slimit && rs->sr_nentries >= si->slimit ) {
+		if ( si->slimit > 0 && rs->sr_nentries >= si->slimit ) {
 			si->slimit_exceeded = 1;
 		}
 
@@ -2460,7 +2460,7 @@ pcache_op_search(
 		si->slimit = 0;
 		si->slimit_exceeded = 0;
 		si->caching_reason = PC_IGNORE;
-		if ( op->ors_slimit && op->ors_slimit < cm->num_entries_limit ) {
+		if ( op->ors_slimit > 0 && op->ors_slimit < cm->num_entries_limit ) {
 			si->slimit = op->ors_slimit;
 			op->ors_slimit = cm->num_entries_limit;
 		}
-- 
GitLab