提交 db6d9d8c 编写于 作者: wmmhello's avatar wmmhello

fix strncpy overlap problem

上级 82691ff4
......@@ -7642,7 +7642,9 @@ static int32_t doAddGroupbyColumnsOnDemand(SSqlCmd* pCmd, SQueryInfo* pQueryInfo
tVariantCreateFromBinary(&(pExpr->base.param[pExpr->base.numOfParams]), t0.z,
t0.n, TSDB_DATA_TYPE_BINARY);
pExpr->base.numOfParams++;
tstrncpy(pColIndex->name, t0.z, t0.n + 1);
assert(t0.n < strlen(pColIndex->name));
memmove(pColIndex->name, t0.z, t0.n);
pColIndex->name[t0.n] = '\0';
}
} else {
// if this query is "group by" normal column, time window query is not allowed
......
......@@ -5725,6 +5725,7 @@ void* getJsonTagValue(STable* pTable, char* key, int32_t keyLen, int16_t* retCol
return NULL;
}
// get key from json->'key'
void getJsonKey(SStrToken *t0){
while(true){
t0->n = tGetToken(t0->z, &t0->type);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册