From 1064610a4bf8a2381f0d15c09d9b0bcbeec50122 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 17 Nov 2021 16:46:15 +0800 Subject: [PATCH] if json->key is bool in () only support 0 and 1 --- src/query/src/qFilter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/query/src/qFilter.c b/src/query/src/qFilter.c index d67cec9288..098bf1b082 100644 --- a/src/query/src/qFilter.c +++ b/src/query/src/qFilter.c @@ -1037,6 +1037,12 @@ int32_t filterConvertSetFromBinary(void **q, const char *buf, int32_t len, uint3 switch (tType) { case TSDB_DATA_TYPE_BOOL: + if (sType != TSDB_DATA_TYPE_BOOL && !IS_SIGNED_NUMERIC_TYPE(sType)) { + goto _return; + } + if (tmpVar.i64 > 1 ||tmpVar.i64 < 0) { + goto _return; + } case TSDB_DATA_TYPE_UTINYINT: case TSDB_DATA_TYPE_TINYINT: { if (tVariantDumpEx(&tmpVar, (char *)&val, tType, false, &converted, &extInfo)) { -- GitLab