From 486d0dae2171b4444da49455ff3e65127b2312f7 Mon Sep 17 00:00:00 2001 From: Thierry Bordaz Date: Wed, 2 Mar 2016 18:53:23 +0100 Subject: [PATCH] Ticket 48752: Page result search should return empty cookie if there is no returned entry Bug Description: The cookie is computed in pagedresults_set_response_control and is set to empty if it is called with curr_search_count=-1. This is difficult reading the code to be sure that, when there is no returned entry, curr_search_count is set to -1 rather than 0. But anyway according to the RFC, the cookie should be empty wether curr_search_count is -1 or 0 Fix Description: Test curr_search_count is less or equal to zero https://fedorahosted.org/389/ticket/48752 Reviewed by: ? Platforms tested: F23 Flag Day: no Doc impact: no --- ldap/servers/slapd/pagedresults.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c index d394dab..f6e3ed8 100644 --- a/ldap/servers/slapd/pagedresults.c +++ b/ldap/servers/slapd/pagedresults.c @@ -244,7 +244,7 @@ pagedresults_set_response_control( Slapi_PBlock *pb, int iscritical, } /* begin sequence, payload, end sequence */ - if (current_search_count < 0) { + if (current_search_count <= 0) { cookie_str = slapi_ch_strdup(""); } else { cookie_str = slapi_ch_smprintf("%d", index); -- 1.7.11.7