Merge pull request #4903 from taosdata/hjxilinx-patch-1
fix char string overflow
This commit is contained in:
commit
52a524624d
|
@ -6101,7 +6101,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) {
|
||||||
int32_t tmpLen = 0;
|
int32_t tmpLen = 0;
|
||||||
tmpLen =
|
tmpLen =
|
||||||
sprintf(tmpBuf, "%s(uid:%" PRId64 ", %d)", aAggs[pExpr->functionId].aName, pExpr->uid, pExpr->colInfo.colId);
|
sprintf(tmpBuf, "%s(uid:%" PRId64 ", %d)", aAggs[pExpr->functionId].aName, pExpr->uid, pExpr->colInfo.colId);
|
||||||
if (tmpLen + offset > totalBufSize) break;
|
if (tmpLen + offset >= totalBufSize - 1) break;
|
||||||
|
|
||||||
offset += sprintf(str + offset, "%s", tmpBuf);
|
offset += sprintf(str + offset, "%s", tmpBuf);
|
||||||
|
|
||||||
|
@ -6110,6 +6110,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(offset < totalBufSize);
|
||||||
str[offset] = ']';
|
str[offset] = ']';
|
||||||
tscDebug("%p select clause:%s", pSql, str);
|
tscDebug("%p select clause:%s", pSql, str);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue