]> 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>
Tue, 23 Mar 2021 04:15:26 +0000 (09:45 +0530)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 30f2066cfdb359c06167068253de0627b15aff91)

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