Skip to content

Commit

Permalink
fix segmentation fault
Browse files Browse the repository at this point in the history
  • Loading branch information
Pengrongkun committed Nov 19, 2024
1 parent a4b6d9d commit fecfbe3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/libs/parser/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fecfbe3

Please sign in to comment.