]> git.sur5r.net Git - openldap/commitdiff
ITS#5065 don't crash if old cookieCSN is sent
authorHoward Chu <hyc@openldap.org>
Fri, 10 Aug 2007 22:52:04 +0000 (22:52 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 10 Aug 2007 22:52:04 +0000 (22:52 +0000)
servers/slapd/syncrepl.c

index 289464fd4fbe82d43b8c825127a703c6b8ef3733..6e3d661473bb5cce7626848f225d3beefda99168 100644 (file)
@@ -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 );