From: Venky Shankar Date: Wed, 10 Mar 2021 13:37:47 +0000 (-0500) Subject: cephfs-mirror: null terminate buffer before synchronizing symbolc link X-Git-Tag: v16.2.0~34^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aca6fe09f92b8892a4a6ff7d2c3d00721972bee9;p=ceph.git cephfs-mirror: null terminate buffer before synchronizing symbolc link Signed-off-by: Venky Shankar (cherry picked from commit 30f2066cfdb359c06167068253de0627b15aff91) --- diff --git a/src/tools/cephfs_mirror/PeerReplayer.cc b/src/tools/cephfs_mirror/PeerReplayer.cc index 89368f3b86aa..86e1dc5f9856 100644 --- a/src/tools/cephfs_mirror/PeerReplayer.cc +++ b/src/tools/cephfs_mirror/PeerReplayer.cc @@ -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