Merge pull request #28354 from taosdata/fix/TD-32386-3.0

fix: add tag length check in stmt
This commit is contained in:
Hongze Cheng 2024-10-14 15:52:24 +08:00 committed by GitHub
commit 95e87bede7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;