diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 289464fd4f..6e3d661473 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2586,6 +2586,11 @@ syncrepl_updateCookie( first = syncCookie->ctxcsn[i]; } } + /* Should never happen, ITS#5065 */ + if ( BER_BVISNULL( &first )) { + ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex ); + return 0; + } op->o_bd = si->si_wbe; slap_queue_csn( op, &first );