diff --git a/source/libs/parser/src/parser.c b/source/libs/parser/src/parser.c index c2714659ec3..c191dc49f8c 100644 --- a/source/libs/parser/src/parser.c +++ b/source/libs/parser/src/parser.c @@ -158,6 +158,10 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) { taosMemoryFreeClear(pVal->datum.p); } + if (!pParam || pParam->buffer_type == TSDB_DATA_TYPE_NULL) { + return TSDB_CODE_APP_ERROR; + } + if (pParam->is_null && 1 == *(pParam->is_null)) { pVal->node.resType.type = TSDB_DATA_TYPE_NULL; pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_NULL].bytes; @@ -445,6 +449,10 @@ static int32_t setValueByBindParam2(SValueNode* pVal, TAOS_STMT2_BIND* pParam) { taosMemoryFreeClear(pVal->datum.p); } + if (!pParam || pParam->buffer_type == TSDB_DATA_TYPE_NULL) { + return TSDB_CODE_APP_ERROR; + } + if (pParam->is_null && 1 == *(pParam->is_null)) { pVal->node.resType.type = TSDB_DATA_TYPE_NULL; pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_NULL].bytes;