From da6e47fa9d621ddb961ceb97695affb610bf61d8 Mon Sep 17 00:00:00 2001 From: Fei Guo <34849868+whdmailbox@users.noreply.github.com> Date: Wed, 10 Nov 2021 17:17:35 +0800 Subject: [PATCH] Update tsdbFile.c to resolve the issue #8342 --- src/tsdb/src/tsdbFile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tsdb/src/tsdbFile.c b/src/tsdb/src/tsdbFile.c index 67696e48a5..77d172893e 100644 --- a/src/tsdb/src/tsdbFile.c +++ b/src/tsdb/src/tsdbFile.c @@ -79,7 +79,7 @@ void *tsdbDecodeSMFileEx(void *buf, SMFile *pMFile) { char *aname; buf = tsdbDecodeMFInfo(buf, &(pMFile->info)); buf = taosDecodeString(buf, &aname); - strncpy(TSDB_FILE_FULL_NAME(pMFile), aname, TSDB_FILENAME_LEN); + tstrncpy(TSDB_FILE_FULL_NAME(pMFile), aname, TSDB_FILENAME_LEN); TSDB_FILE_SET_CLOSED(pMFile); tfree(aname); @@ -345,7 +345,7 @@ static void *tsdbDecodeSDFileEx(void *buf, SDFile *pDFile) { // The sync module would send DFileSet with latest verion. buf = tsdbDecodeDFInfo(buf, &(pDFile->info), TSDB_LATEST_SFS_VER); buf = taosDecodeString(buf, &aname); - strncpy(TSDB_FILE_FULL_NAME(pDFile), aname, TSDB_FILENAME_LEN); + tstrncpy(TSDB_FILE_FULL_NAME(pDFile), aname, TSDB_FILENAME_LEN); TSDB_FILE_SET_CLOSED(pDFile); tfree(aname); @@ -716,4 +716,4 @@ static void tsdbGetFilename(int vid, int fid, uint32_t ver, TSDB_FILE_T ftype, c snprintf(fname, TSDB_FILENAME_LEN, "vnode/vnode%d/tsdb/%s-ver%" PRIu32, vid, TSDB_FNAME_SUFFIX[ftype], ver); } } -} \ No newline at end of file +} -- GitLab