]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9043 Nul-terminate csn string
authorOndřej Kuzník <ondra@mistotebe.net>
Thu, 10 Sep 2020 10:03:37 +0000 (11:03 +0100)
committerOndřej Kuzník <ondra@mistotebe.net>
Thu, 10 Sep 2020 10:03:37 +0000 (11:03 +0100)
servers/slapd/overlays/syncprov.c

index b1c7b81fa858f2ab7f9810da9b122d540a64218f..2e80e55c4350ed2b6ccae745faf9b12dc08d6b69 100644 (file)
@@ -2078,12 +2078,14 @@ syncprov_play_sessionlog( Operation *op, SlapReply *rs, sync_control *srs,
                csns[j].bv_val = csns[0].bv_val + (j * LDAP_PVT_CSNSTR_BUFSIZE);
                AC_MEMCPY(csns[j].bv_val, se->se_csn.bv_val, se->se_csn.bv_len);
                csns[j].bv_len = se->se_csn.bv_len;
+               /* We're printing it */
+               csns[j].bv_val[csns[j].bv_len] = '\0';
 
                if ( LogTest( LDAP_DEBUG_SYNC ) ) {
                        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",
-                               uuidstr, csns[j].bv_len ? csns[j].bv_val : "(null)" );
+                               uuidstr, csns[j].bv_val );
                }
        }
        ldap_pvt_thread_mutex_lock( &sl->sl_mutex );