You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by yj...@apache.org on 2025/01/06 08:39:47 UTC
(cloudberry) 19/20: fix: Add bounds checking for aggregate filter array access
This is an automated email from the ASF dual-hosted git repository.
yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 6584d1bfe08da124ddeb139d5c17ad8e30fc02a2
Author: Jianghua Yang <yj...@gmail.com>
AuthorDate: Fri Jan 3 16:33:49 2025 +0800
fix: Add bounds checking for aggregate filter array access
Prevent potential array out of bounds access by validating the expression ID
is within the valid range of distinct qualified aggregates before accessing
the aggregate filter array.
---
src/backend/executor/nodeTupleSplit.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/backend/executor/nodeTupleSplit.c b/src/backend/executor/nodeTupleSplit.c
index 19a6b49c25..90d14d3622 100644
--- a/src/backend/executor/nodeTupleSplit.c
+++ b/src/backend/executor/nodeTupleSplit.c
@@ -187,7 +187,10 @@ ExecTupleSplit(PlanState *pstate)
econtext->ecxt_outertuple = node->outerslot;
/* The filter is pushed down from relative DQA */
- ExprState * filter = node->agg_filter_array[node->currentExprId];
+ ExprState * filter = NULL;
+ if (node->currentExprId < node->numDisDQAs)
+ filter = node->agg_filter_array[node->currentExprId];
+
if (filter)
{
Datum res;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org