Merge pull request #17231 from taosdata/szhou/fixbugs

fix: fix coverity scan issues
This commit is contained in:
Shengliang Guan 2022-10-09 15:44:44 +08:00 committed by GitHub
commit c1ed4da67d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -959,8 +959,8 @@ int32_t udfdInitResidentFuncs() {
char* pSave = tsUdfdResFuncs;
char* token;
while ((token = strtok_r(pSave, ",", &pSave)) != NULL) {
char func[TSDB_FUNC_NAME_LEN] = {0};
strncpy(func, token, sizeof(func));
char func[TSDB_FUNC_NAME_LEN+1] = {0};
strncpy(func, token, TSDB_FUNC_NAME_LEN);
taosArrayPush(global.residentFuncs, func);
}