diff --git a/source/common/src/trow.c b/source/common/src/trow.c index d39d3c501a4c3df1afe4f1389865bd98906dacbd..653cd34b3717d9cf870fad2676519864c7fe5a6e 100644 --- a/source/common/src/trow.c +++ b/source/common/src/trow.c @@ -412,7 +412,9 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) { valType = TD_VTYPE_NULL; } else if (IS_VAR_DATA_TYPE(pTColumn->type)) { varDataSetLen(varBuf, pColVal->value.nData); - memcpy(varDataVal(varBuf), pColVal->value.pData, pColVal->value.nData); + if (pColVal->value.nData != 0) { + memcpy(varDataVal(varBuf), pColVal->value.pData, pColVal->value.nData); + } val = varBuf; } else { val = (const void *)&pColVal->value.val; @@ -1094,4 +1096,4 @@ void tTSRowGetVal(STSRow *pRow, STSchema *pTSchema, int16_t iCol, SColVal *pColV memcpy(&pColVal->value.val, cv.val, tDataTypes[pTColumn->type].bytes); } } -} \ No newline at end of file +}