提交 c8782ff7 编写于 作者: S shenglian zhou

fix errors caused by buffer overflow

上级 417fb694
...@@ -874,7 +874,7 @@ static int32_t addChildTableDataPointsToInsertSql(char* cTableName, char* sTable ...@@ -874,7 +874,7 @@ static int32_t addChildTableDataPointsToInsertSql(char* cTableName, char* sTable
free(colKVs); free(colKVs);
if (r == fromIndex) { if (r == fromIndex) {
tscError("buf can not fit one line"); tscError("buffer can not fit one line");
} }
*nextIndex = r; *nextIndex = r;
*cTableSqlLen = totalLen; *cTableSqlLen = totalLen;
...@@ -984,8 +984,6 @@ static int32_t applyDataPointsWithSqlInsert(TAOS* taos, TAOS_SML_DATA_POINT* poi ...@@ -984,8 +984,6 @@ static int32_t applyDataPointsWithSqlInsert(TAOS* taos, TAOS_SML_DATA_POINT* poi
pCTablePoints = taosHashIterate(cname2points, pCTablePoints); pCTablePoints = taosHashIterate(cname2points, pCTablePoints);
} }
usedBytes += cTableSqlLen;
freeBytes -= cTableSqlLen;
batch->sql[usedBytes] = '\0'; batch->sql[usedBytes] = '\0';
info->numBatches++; info->numBatches++;
tscDebug("SML:0x%"PRIx64" sql: %s" , info->id, batch->sql); tscDebug("SML:0x%"PRIx64" sql: %s" , info->id, batch->sql);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册