From a01f1a4e1d5752ab7c0e8f97d2ba8901eba4cd3b Mon Sep 17 00:00:00 2001 From: slzhou Date: Fri, 22 Apr 2022 08:45:38 +0800 Subject: [PATCH] fix unit test case that causes core dump --- source/dnode/mgmt/implement/src/dmHandle.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/dnode/mgmt/implement/src/dmHandle.c b/source/dnode/mgmt/implement/src/dmHandle.c index 7b7ab7fa9a..376f589acd 100644 --- a/source/dnode/mgmt/implement/src/dmHandle.c +++ b/source/dnode/mgmt/implement/src/dmHandle.c @@ -236,8 +236,12 @@ static int32_t dmSpawnUdfd(SDnode *pDnode) { uv_process_options_t options = {0}; char path[PATH_MAX] = {0}; - strncpy(path, tsProcPath, strlen(tsProcPath)); - char* dirName = taosDirName(path); + if (tsProcPath == NULL) { + path[0] = '.'; + } else { + strncpy(path, tsProcPath, strlen(tsProcPath)); + taosDirName(path); + } strcat(path, "/udfd"); char* argsUdfd[] = {path, "-c", configDir, NULL}; options.args = argsUdfd;