From 9a82f3521bf40d6e264d1074215a8b7164d52ca1 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Sun, 9 Oct 2022 10:55:38 +0800 Subject: [PATCH] fix: fix coverity scan issues --- source/libs/function/src/udfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 8ff0dc15a5..14e358ea00 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -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); }