未验证 提交 55de47d1 编写于 作者: H huili 提交者: GitHub

Merge pull request #4183 from taosdata/bugfix/TD-2055

[TD-2055]<fix>: core dump in wildcard query
...@@ -2348,7 +2348,8 @@ void filterPrepare(void* expr, void* param) { ...@@ -2348,7 +2348,8 @@ void filterPrepare(void* expr, void* param) {
if (size < (uint32_t)pSchema->bytes) { if (size < (uint32_t)pSchema->bytes) {
size = pSchema->bytes; size = pSchema->bytes;
} }
pInfo->q = calloc(1, size + TSDB_NCHAR_SIZE); // to make sure tonchar does not cause invalid write, since the '\0' needs at least sizeof(wchar_t) space. // to make sure tonchar does not cause invalid write, since the '\0' needs at least sizeof(wchar_t) space.
pInfo->q = calloc(1, size + TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE);
tVariantDump(pCond, pInfo->q, pSchema->type, true); tVariantDump(pCond, pInfo->q, pSchema->type, true);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册