fix:heap overflow if print json value node

This commit is contained in:
wangmm0220 2023-12-11 19:46:51 +08:00
parent 1bf3f2d1bd
commit b99b9986b8
1 changed files with 2 additions and 2 deletions

View File

@ -1367,8 +1367,8 @@ EDealRes sclRewriteCaseWhen(SNode **pNode, SScalarCtx *ctx) {
} else { } else {
int32_t type = output.columnData->info.type; int32_t type = output.columnData->info.type;
if (IS_VAR_DATA_TYPE(type)) { // todo refactor if (IS_VAR_DATA_TYPE(type)) { // todo refactor
res->datum.p = output.columnData->pData; res->datum.p = taosMemoryCalloc(varDataTLen(output.columnData->pData) + 1, sizeof(char)); // add \0 to the end for print json value
output.columnData->pData = NULL; memcpy(res->datum.p, output.columnData->pData, varDataTLen(output.columnData->pData));
} else { } else {
nodesSetValueNodeValue(res, output.columnData->pData); nodesSetValueNodeValue(res, output.columnData->pData);
} }