pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid reference to nonexistent array element in ExecInitAgg().
6+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid reference to nonexistent array element in ExecInitAgg().
@ 2023-01-02 21:17 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-01-02 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid reference to nonexistent array element in ExecInitAgg().

When considering an empty grouping set, we fetched
phasedata->eqfunctions[-1].  Because the eqfunctions array is
palloc'd, that would always be an aset pointer in released versions,
and thus the code accidentally failed to malfunction (since it would
do nothing unless it found a null pointer).  Nonetheless this seems
like 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 Guo

Discussion: https://postgr.es/m/CAMbWs4-vZuuPOZsKOYnSAaPYGKhmacxhki+vpOKk0O7rymccXQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/92957ed98c5c565362ce665266132a7f08f6b0c0

Modified Files
--------------
src/backend/executor/nodeAgg.c | 5 +++++
1 file changed, 5 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid reference to nonexistent array element in ExecInitAgg().
@ 2023-01-02 21:17 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-01-02 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid reference to nonexistent array element in ExecInitAgg().

When considering an empty grouping set, we fetched
phasedata->eqfunctions[-1].  Because the eqfunctions array is
palloc'd, that would always be an aset pointer in released versions,
and thus the code accidentally failed to malfunction (since it would
do nothing unless it found a null pointer).  Nonetheless this seems
like 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 Guo

Discussion: https://postgr.es/m/CAMbWs4-vZuuPOZsKOYnSAaPYGKhmacxhki+vpOKk0O7rymccXQ@mail.gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fbed54fb3890894055072381bb13850baf524ba5

Modified Files
--------------
src/backend/executor/nodeAgg.c | 5 +++++
1 file changed, 5 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid reference to nonexistent array element in ExecInitAgg().
@ 2023-01-02 21:17 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-01-02 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid reference to nonexistent array element in ExecInitAgg().

When considering an empty grouping set, we fetched
phasedata->eqfunctions[-1].  Because the eqfunctions array is
palloc'd, that would always be an aset pointer in released versions,
and thus the code accidentally failed to malfunction (since it would
do nothing unless it found a null pointer).  Nonetheless this seems
like 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 Guo

Discussion: https://postgr.es/m/CAMbWs4-vZuuPOZsKOYnSAaPYGKhmacxhki+vpOKk0O7rymccXQ@mail.gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a02740e53fb7d1668e2d0ea1362743d23211d43d

Modified Files
--------------
src/backend/executor/nodeAgg.c | 5 +++++
1 file changed, 5 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid reference to nonexistent array element in ExecInitAgg().
@ 2023-01-02 21:17 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-01-02 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid reference to nonexistent array element in ExecInitAgg().

When considering an empty grouping set, we fetched
phasedata->eqfunctions[-1].  Because the eqfunctions array is
palloc'd, that would always be an aset pointer in released versions,
and thus the code accidentally failed to malfunction (since it would
do nothing unless it found a null pointer).  Nonetheless this seems
like 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 Guo

Discussion: https://postgr.es/m/CAMbWs4-vZuuPOZsKOYnSAaPYGKhmacxhki+vpOKk0O7rymccXQ@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/19adcaf00f7d8480f231bcfbb6b7a4401a531ce5

Modified Files
--------------
src/backend/executor/nodeAgg.c | 5 +++++
1 file changed, 5 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid reference to nonexistent array element in ExecInitAgg().
@ 2023-01-02 21:17 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-01-02 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid reference to nonexistent array element in ExecInitAgg().

When considering an empty grouping set, we fetched
phasedata->eqfunctions[-1].  Because the eqfunctions array is
palloc'd, that would always be an aset pointer in released versions,
and thus the code accidentally failed to malfunction (since it would
do nothing unless it found a null pointer).  Nonetheless this seems
like 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 Guo

Discussion: https://postgr.es/m/CAMbWs4-vZuuPOZsKOYnSAaPYGKhmacxhki+vpOKk0O7rymccXQ@mail.gmail.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/039567eb57ee5a5ab1a2ad2352316b2d31e7150e

Modified Files
--------------
src/backend/executor/nodeAgg.c | 5 +++++
1 file changed, 5 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid reference to nonexistent array element in ExecInitAgg().
@ 2023-01-02 21:17 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2023-01-02 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid reference to nonexistent array element in ExecInitAgg().

When considering an empty grouping set, we fetched
phasedata->eqfunctions[-1].  Because the eqfunctions array is
palloc'd, that would always be an aset pointer in released versions,
and thus the code accidentally failed to malfunction (since it would
do nothing unless it found a null pointer).  Nonetheless this seems
like 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 Guo

Discussion: https://postgr.es/m/CAMbWs4-vZuuPOZsKOYnSAaPYGKhmacxhki+vpOKk0O7rymccXQ@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/982b9b1eba8d809cd677009d15ca045cea890c69

Modified Files
--------------
src/backend/executor/nodeAgg.c | 5 +++++
1 file changed, 5 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2023-01-02 21:17 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 21:17 pgsql: Avoid reference to nonexistent array element in ExecInitAgg(). Tom Lane <tgl@sss.pgh.pa.us>
2023-01-02 21:17 pgsql: Avoid reference to nonexistent array element in ExecInitAgg(). Tom Lane <tgl@sss.pgh.pa.us>
2023-01-02 21:17 pgsql: Avoid reference to nonexistent array element in ExecInitAgg(). Tom Lane <tgl@sss.pgh.pa.us>
2023-01-02 21:17 pgsql: Avoid reference to nonexistent array element in ExecInitAgg(). Tom Lane <tgl@sss.pgh.pa.us>
2023-01-02 21:17 pgsql: Avoid reference to nonexistent array element in ExecInitAgg(). Tom Lane <tgl@sss.pgh.pa.us>
2023-01-02 21:17 pgsql: Avoid reference to nonexistent array element in ExecInitAgg(). Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox