From: Howard Chu Date: Wed, 9 Apr 2008 03:08:38 +0000 (+0000) Subject: ITS#5409 must reset pagedresults state if no cookie is provided X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~30 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f0bb1739a7b95cb7ada494d825da8a6b47da86c8;p=openldap ITS#5409 must reset pagedresults state if no cookie is provided --- diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index abe130f550..3bbe0a7abc 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -1160,10 +1160,6 @@ parse_paged_cookie( Operation *op, SlapReply *rs ) goto done; } - } else { - /* Initial request. Initialize state. */ - ps->ps_cookie = 0; - ps->ps_count = 0; } done:; diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index b7f66eeab2..042fccca8f 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -1102,6 +1102,10 @@ static int parsePagedResults ( ps->ps_size = size; ps->ps_cookieval = cookie; op->o_pagedresults_state = ps; + if ( !cookie.bv_len ) { + ps->ps_count = 0; + ps->ps_cookie = 0; + } /* NOTE: according to RFC 2696 3.: