]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9043 Make sure uuidstr is initialised on use
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 8 Jul 2020 11:54:08 +0000 (12:54 +0100)
committerOndřej Kuzník <ondra@mistotebe.net>
Wed, 8 Jul 2020 11:54:08 +0000 (12:54 +0100)
servers/slapd/overlays/syncprov.c

index 98782514832f7ff5893f6296df5386533a36d4ec..5a7f6cbae46d6d240de59c6a7c2f2fcde1d18ea4 100644 (file)
@@ -1845,12 +1845,14 @@ syncprov_play_sessionlog( Operation *op, SlapReply *rs, sync_control *srs,
                "sync control csn %s\n",
                op->o_log_prefix, srs->sr_state.ctxcsn[0].bv_val );
        for ( se=sl->sl_head; se; se=se->se_next ) {
+               char uuidstr[40] = {};
                int k;
 
                if ( LogTest( LDAP_DEBUG_SYNC ) ) {
-                       char uuidstr[40];
-                       lutil_uuidstr_from_normalized( se->se_uuid.bv_val, se->se_uuid.bv_len,
-                               uuidstr, 40 );
+                       if ( !BER_BVISEMPTY( &se->se_uuid ) ) {
+                               lutil_uuidstr_from_normalized( se->se_uuid.bv_val, se->se_uuid.bv_len,
+                                       uuidstr, 40 );
+                       }
                        Debug( LDAP_DEBUG_SYNC, "%s syncprov_play_sessionlog: "
                                "log entry tag=%lu uuid=%s cookie=%s\n",
                                op->o_log_prefix, se->se_tag, uuidstr, se->se_csn.bv_val );
@@ -1900,9 +1902,6 @@ syncprov_play_sessionlog( Operation *op, SlapReply *rs, sync_control *srs,
                csns[j].bv_len = se->se_csn.bv_len;
 
                if ( LogTest( LDAP_DEBUG_SYNC ) ) {
-                       char uuidstr[40];
-                       lutil_uuidstr_from_normalized( uuids[j].bv_val, uuids[j].bv_len,
-                               uuidstr, 40 );
                        Debug( LDAP_DEBUG_SYNC, "%s syncprov_play_sessionlog: "
                                "picking a %s entry uuid=%s cookie=%s\n",
                                op->o_log_prefix, se->se_tag == LDAP_REQ_DELETE ? "deleted" : "modified",