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

Commit039567e

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 parent5a93c8f commit039567e

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
@@ -2409,6 +2409,11 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
24092409
{
24102410
intlength=phasedata->gset_lengths[i];
24112411

2412+
/* nothing to do for empty grouping set */
2413+
if (length==0)
2414+
continue;
2415+
2416+
/* if we already had one of this length, it'll do */
24122417
if (phasedata->eqfunctions[length-1]!=NULL)
24132418
continue;
24142419

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp