From ae152157f740a1304c523bff06255550512d262f Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Sun, 28 Apr 2013 12:47:14 -0700
Subject: [PATCH] ITS#7577 more for previous commit

---
 servers/slapd/back-mdb/search.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/servers/slapd/back-mdb/search.c b/servers/slapd/back-mdb/search.c
index 30e2eeda65..0b2057202b 100644
--- a/servers/slapd/back-mdb/search.c
+++ b/servers/slapd/back-mdb/search.c
@@ -649,8 +649,10 @@ dn2entry_retry:
 					continue;
 				iscopes[cursor++] = scopes[cscope].mid;
 			}
+			iscopes[0] = scopes[0].mid - 1;
+		} else {
+			iscopes[0] = 0;
 		}
-		iscopes[0] = scopes[0].mid - 1;
 
 		isc.id = base->e_id;
 		isc.numrdns = 0;
-- 
GitLab