From a370d94857dc0b62c4379f96bd2aba3a8d9d28f8 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Tue, 16 Aug 2022 11:38:45 +0800 Subject: [PATCH] fix(query): check the upper boundary of startPos in hashIntervalAgg --- src/query/src/qExecutor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 3edd19e016..6ba582138c 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -1704,7 +1704,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul while (1) { int32_t prevEndPos = (forwardStep - 1) * step + startPos; startPos = getNextQualifiedWindow(pQueryAttr, &nextWin, &pSDataBlock->info, tsCols, binarySearchForKey, prevEndPos); - if (startPos < 0) { + if (startPos < 0 || startPos >= pSDataBlock->info.rows) { break; } -- GitLab