[TD-225]fix potential overflow in char array.

This commit is contained in:
Haojun Liao 2021-01-13 11:35:48 +08:00
parent 9017b178cb
commit 11ace7f5c0
1 changed files with 1 additions and 1 deletions

View File

@ -6084,7 +6084,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) {
int32_t tmpLen = 0;
tmpLen =
sprintf(tmpBuf, "%s(uid:%" PRId64 ", %d)", aAggs[pExpr->functionId].aName, pExpr->uid, pExpr->colInfo.colId);
if (tmpLen + offset > totalBufSize) break;
if (tmpLen + offset + 1 >= totalBufSize) break;
offset += sprintf(str + offset, "%s", tmpBuf);