]> git.sur5r.net Git - openldap/commitdiff
error if syncUUID is empty
authorPierangelo Masarati <ando@openldap.org>
Tue, 8 Nov 2005 00:03:58 +0000 (00:03 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 8 Nov 2005 00:03:58 +0000 (00:03 +0000)
servers/slapd/syncrepl.c

index 4c1cbf49f0bd77468316b2e064f47edef336dc92..066218f95a45f027c9c0efd99a05fbd5a7e67d17 100644 (file)
@@ -691,7 +691,14 @@ do_syncrep2(
                                rctrlp = *rctrls;
                                ber_init2( ber, &rctrlp->ldctl_value, LBER_USE_DER );
                                ber_scanf( ber, "{em" /*"}"*/, &syncstate, &syncUUID );
-                               /* FIXME: what if syncUUID is NULL or empty? */
+                               /* FIXME: what if syncUUID is NULL or empty?
+                                * (happens with back-sql...) */
+                               if ( BER_BVISEMPTY( &syncUUID ) ) {
+                                       Debug( LDAP_DEBUG_ANY, "do_syncrep2: "
+                                               "got empty syncUUID\n", 0, 0, 0 );
+                                       rc = -1;
+                                       goto done;
+                               }
                                if ( ber_peek_tag( ber, &len ) == LDAP_TAG_SYNC_COOKIE ) {
                                        ber_scanf( ber, /*"{"*/ "m}", &cookie );
                                        if ( !BER_BVISNULL( &cookie ) ) {