fix:heap overflow if print json value node
This commit is contained in:
parent
1bf3f2d1bd
commit
b99b9986b8
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue