From f0bb1739a7b95cb7ada494d825da8a6b47da86c8 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 9 Apr 2008 03:08:38 +0000 Subject: [PATCH] ITS#5409 must reset pagedresults state if no cookie is provided --- servers/slapd/back-bdb/search.c | 4 ---- servers/slapd/controls.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) 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.: -- 2.39.5