Skip to content

Commit fecfbe3

Browse files
committed
fix segmentation fault
1 parent a4b6d9d commit fecfbe3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/libs/parser/src/parser.c

+8
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) {
158158
taosMemoryFreeClear(pVal->datum.p);
159159
}
160160

161+
if (!pParam || pParam->buffer_type == TSDB_DATA_TYPE_NULL) {
162+
return TSDB_CODE_APP_ERROR;
163+
}
164+
161165
if (pParam->is_null && 1 == *(pParam->is_null)) {
162166
pVal->node.resType.type = TSDB_DATA_TYPE_NULL;
163167
pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_NULL].bytes;
@@ -445,6 +449,10 @@ static int32_t setValueByBindParam2(SValueNode* pVal, TAOS_STMT2_BIND* pParam) {
445449
taosMemoryFreeClear(pVal->datum.p);
446450
}
447451

452+
if (!pParam || pParam->buffer_type == TSDB_DATA_TYPE_NULL) {
453+
return TSDB_CODE_APP_ERROR;
454+
}
455+
448456
if (pParam->is_null && 1 == *(pParam->is_null)) {
449457
pVal->node.resType.type = TSDB_DATA_TYPE_NULL;
450458
pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_NULL].bytes;

0 commit comments

Comments
 (0)