From 1aa4258aef47491e96a1b30b3c02a5ca65f322c4 Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Mon, 2 Dec 2024 14:11:43 +0800 Subject: [PATCH] Fix mem error in readCfg. --- source/common/src/tglobal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 3741c75db1..58fbbaf40f 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -2002,6 +2002,7 @@ int32_t readCfgFile(const char *path, bool isGlobal) { code = terrno; goto _exit; } + buf[fileSize] = 0; code = cfgDeserialize(array, buf, isGlobal); if (code != TSDB_CODE_SUCCESS) { uError("failed to deserialize config from %s since %s", filename, tstrerror(code));