From 51d9d54ddcea0c364e97cdba357f345bb461792f Mon Sep 17 00:00:00 2001 From: freemine Date: Sun, 7 Jun 2020 11:00:22 +0800 Subject: [PATCH] allocate enough space to holding null-terminator, especially in case of wchar_t --- src/client/src/tscUtil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 2bde10f076..caf424080d 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1153,7 +1153,7 @@ SColumnFilterInfo* tscFilterInfoClone(const SColumnFilterInfo* src, int32_t numO for (int32_t j = 0; j < numOfFilters; ++j) { if (pFilter[j].filterstr) { - size_t len = (size_t) pFilter[j].len + 1; + size_t len = (size_t) pFilter[j].len + 1 * TSDB_NCHAR_SIZE; pFilter[j].pz = (int64_t) calloc(1, len); memcpy((char*)pFilter[j].pz, (char*)src[j].pz, (size_t)len); -- GitLab