diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index dd2470bd2e5332b862d30e286b2082fdfb6613ae..af4cd08edbccf20532f3560a064c2f1713589fb4 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6071,7 +6071,8 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { bool dbIncluded = false; SStrToken tmpToken = pAlterSQL->name; - char tmpTokenBuf[pAlterSQL->name.n]; + const int32_t bufLen = pAlterSQL->name.n; + char tmpTokenBuf[bufLen]; tmpToken.z = tmpTokenBuf; memcpy(tmpTokenBuf, pAlterSQL->name.z, pAlterSQL->name.n); if (tscValidateName(&tmpToken, true, &dbIncluded) != TSDB_CODE_SUCCESS) {