diff --git a/src/gausskernel/storage/smgr/md.cpp b/src/gausskernel/storage/smgr/md.cpp index 522715786..e2e64375c 100644 --- a/src/gausskernel/storage/smgr/md.cpp +++ b/src/gausskernel/storage/smgr/md.cpp @@ -2052,6 +2052,8 @@ int SyncMdFile(const FileTag *ftag, char *path) if (compressNode) { CopyCompressedPath(dst, path); openFilePath = dst; + errno_t rc = strcpy_s(path, MAXPGPATH, dst); + securec_check_c(rc, "\0", "\0"); } BlockNumber relSegSize = compressNode ? CFS_LOGIC_BLOCKS_PER_FILE : RELSEG_SIZE; /* Try to open the requested segment. */