From aca6fe09f92b8892a4a6ff7d2c3d00721972bee9 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 10 Mar 2021 08:37:47 -0500 Subject: [PATCH] cephfs-mirror: null terminate buffer before synchronizing symbolc link Signed-off-by: Venky Shankar (cherry picked from commit 30f2066cfdb359c06167068253de0627b15aff91) --- src/tools/cephfs_mirror/PeerReplayer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/cephfs_mirror/PeerReplayer.cc b/src/tools/cephfs_mirror/PeerReplayer.cc index 89368f3b86aa4..86e1dc5f9856a 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 -- 2.39.5