提交 d5e0bfc4 编写于 作者: H Haojun Liao

[td-225] fix invalid write in tbname query

上级 8114e1e7
...@@ -1062,10 +1062,9 @@ tExprNode* exprTreeFromTableName(const char* tbnameCond) { ...@@ -1062,10 +1062,9 @@ tExprNode* exprTreeFromTableName(const char* tbnameCond) {
if (*e == TS_PATH_DELIMITER[0]) { if (*e == TS_PATH_DELIMITER[0]) {
cond = e + 1; cond = e + 1;
} else if (*e == ',') { } else if (*e == ',') {
size_t len = e - cond + VARSTR_HEADER_SIZE; size_t len = e - cond;
char* p = exception_malloc(len); char* p = exception_malloc(len + VARSTR_HEADER_SIZE);
varDataSetLen(p, len - VARSTR_HEADER_SIZE); STR_WITH_SIZE_TO_VARSTR(p, cond, len);
memcpy(varDataVal(p), cond, len);
cond += len; cond += len;
taosArrayPush(pVal->arr, &p); taosArrayPush(pVal->arr, &p);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册