From 005209bfe12ab9ddd275a3a2a67f38efbbda1d1d Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 4 Nov 2007 12:34:41 +0000 Subject: [PATCH] ITS#5211 spec says we must ignore invalid cookies --- servers/slapd/overlays/syncprov.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 950f3b30a3..0a443bd9a1 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -2840,10 +2840,14 @@ static int syncprov_parseCtrl ( sr->sr_rhint = rhint; if (!BER_BVISNULL(&cookie)) { ber_dupbv_x( &sr->sr_state.octet_str, &cookie, op->o_tmpmemctx ); + /* If parse fails, pretend no cookie was sent */ if ( slap_parse_sync_cookie( &sr->sr_state, op->o_tmpmemctx ) || sr->sr_state.rid == -1 ) { - rs->sr_text = "Sync control : cookie parsing error"; - return LDAP_PROTOCOL_ERROR; + if ( sr->sr_state.ctxcsn ) { + ber_bvarray_free_x( sr->sr_state.ctxcsn, op->o_tmpmemctx ); + sr->sr_state.ctxcsn = NULL; + } + sr->sr_state.numcsns = 0; } } -- 2.39.5