From 36c19fc824f637cd7745e7ff8f4e5becb0d8defa Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 19 Jul 2022 10:39:05 +0800 Subject: [PATCH] fix:tag is too long if type is nchar in schemaless influxdb --- source/client/src/clientSml.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 49f26e2c24..078ecbb4db 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -1217,6 +1217,9 @@ static int32_t smlParseCols(const char *data, int32_t len, SArray *cols, char *c kv->value = value; kv->length = valueLen; if (isTag) { + if(valueLen > (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE){ + return TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN; + } kv->type = TSDB_DATA_TYPE_NCHAR; } else { int32_t ret = smlParseValue(kv, msg);