From b9db84586cd29cfbfbed767bec46f624c6555c36 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 30 Jul 2021 02:17:10 +0800 Subject: [PATCH] [TD-5534]:fix high risk strncpy to tstrncpy --- src/client/src/tscSQLParser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 8be38be504..0a018c863f 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -8415,7 +8415,7 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS return invalidOperationMsg(msgBuf, "subquery alias name too long"); } - tstrncpy(pTableMetaInfo1->aliasName, subInfo->aliasName.z, sizeof(pTableMetaInfo1->aliasName)); + tstrncpy(pTableMetaInfo1->aliasName, subInfo->aliasName.z, subInfo->aliasName.n + 1); } taosArrayPush(pQueryInfo->pUpstream, &pSub); -- GitLab