postgresql/src
Tom Lane 982b9b1eba 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
2023-01-02 16:17:00 -05:00
..
backend Avoid reference to nonexistent array element in ExecInitAgg(). 2023-01-02 16:17:00 -05:00
bin pg_dump: avoid unsafe function calls in getPolicies(). 2022-11-19 12:00:27 -05:00
common Inhibit mingw CRT's auto-globbing of command line arguments 2022-04-25 15:51:27 -04:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Rethink handling of [Prevent|Is]InTransactionBlock in pipeline mode. 2022-12-13 14:23:59 -05:00
interfaces Fix comment in fe-auth-scram.c 2022-11-30 08:38:40 +09:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:36 -04:00
pl Allow building with MSVC and Strawberry perl 2022-11-25 15:37:34 -05:00
port Stamp 11.18. 2022-11-07 16:49:11 -05:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:29:17 -04:00
test Fix DEFAULT handling for multi-row INSERT rules. 2022-12-03 12:20:02 +00:00
timezone Update time zone data files to tzdata release 2022f. 2022-11-01 17:09:16 -04:00
tools Fix binary mismatch for MSVC plperl vs gcc built perl libs 2022-11-27 09:18:46 -05:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Prevent port collisions between concurrent TAP tests 2022-11-22 10:53:01 -05:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00