fix: add tag length check in stmt

This commit is contained in:
Hongze Cheng 2024-10-14 14:21:38 +08:00
parent 80e2e426f0
commit f9405b35d3
1 changed files with 8 additions and 0 deletions

View File

@ -218,6 +218,10 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
} else {
memcpy(&val.i64, bind[c].buffer, colLen);
}
if (IS_VAR_DATA_TYPE(pTagSchema->type) && val.nData > pTagSchema->bytes) {
code = TSDB_CODE_PAR_VALUE_TOO_LONG;
goto end;
}
if (NULL == taosArrayPush(pTagArray, &val)) {
code = terrno;
goto end;
@ -566,6 +570,10 @@ int32_t qBindStmtTagsValue2(void* pBlock, void* boundTags, int64_t suid, const c
} else {
memcpy(&val.i64, bind[c].buffer, colLen);
}
if (IS_VAR_DATA_TYPE(pTagSchema->type) && val.nData > pTagSchema->bytes) {
code = TSDB_CODE_PAR_VALUE_TOO_LONG;
goto end;
}
if (NULL == taosArrayPush(pTagArray, &val)) {
code = terrno;
goto end;