]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-mirror: null terminate buffer before synchronizing symbolc link
authorVenky Shankar <vshankar@redhat.com>
Wed, 10 Mar 2021 13:37:47 +0000 (08:37 -0500)
committerVenky Shankar <vshankar@redhat.com>
Fri, 12 Mar 2021 08:52:59 +0000 (03:52 -0500)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/tools/cephfs_mirror/PeerReplayer.cc

index 89368f3b86aa4d287f2ca341be4d99972894c9f4..86e1dc5f9856af84a5f881ba956b45e06e933f61 100644 (file)
@@ -681,6 +681,7 @@ int PeerReplayer::remote_file_op(const std::string &dir_path,
       return r;
     }
 
+    target[stx.stx_size] = '\0';
     r = ceph_symlink(m_remote_mount, target, remote_path.c_str());
     if (r < 0 && r != EEXIST) {
       derr << ": failed to symlink remote path=" << remote_path << " to target=" << target