Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit19adcaf

Browse files
committed
Avoid reference to nonexistent array element in ExecInitAgg().
When considering an empty grouping set, we fetchedphasedata->eqfunctions[-1]. Because the eqfunctions array ispalloc'd, that would always be an aset pointer in released versions,and thus the code accidentally failed to malfunction (since it woulddo nothing unless it found a null pointer). Nonetheless this seemslike trouble waiting to happen, so add a check for length == 0.It's depressing that our valgrind testing did not catch this.Maybe we should reconsider the choice to not mark that word NOACCESS?Richard GuoDiscussion:https://postgr.es/m/CAMbWs4-vZuuPOZsKOYnSAaPYGKhmacxhki+vpOKk0O7rymccXQ@mail.gmail.com
1 parent58dcac0 commit19adcaf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/backend/executor/nodeAgg.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,6 +3570,11 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
35703570
{
35713571
intlength=phasedata->gset_lengths[i];
35723572

3573+
/* nothing to do for empty grouping set */
3574+
if (length==0)
3575+
continue;
3576+
3577+
/* if we already had one of this length, it'll do */
35733578
if (phasedata->eqfunctions[length-1]!=NULL)
35743579
continue;
35753580

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp