From ad56719d9b745e950a03e4a04e3b40e69fe69a9b Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 18 Sep 2024 16:03:26 +0800 Subject: [PATCH] stmt2/bind tags: fail with null var tag length --- source/libs/parser/src/parInsertStmt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/parser/src/parInsertStmt.c b/source/libs/parser/src/parInsertStmt.c index ea11f7434f..7792e93d9d 100644 --- a/source/libs/parser/src/parInsertStmt.c +++ b/source/libs/parser/src/parInsertStmt.c @@ -499,6 +499,10 @@ int32_t qBindStmtTagsValue2(void* pBlock, void* boundTags, int64_t suid, const c SSchema* pTagSchema = &pSchema[tags->pColIndex[c]]; int32_t colLen = pTagSchema->bytes; if (IS_VAR_DATA_TYPE(pTagSchema->type)) { + if (!bind[c].length) { + code = buildInvalidOperationMsg(&pBuf, "var tag length is null"); + goto end; + } colLen = bind[c].length[0]; if ((colLen + VARSTR_HEADER_SIZE) > pTagSchema->bytes) { code = buildInvalidOperationMsg(&pBuf, "tag length is too big");