postgresql/src/backend
Tom Lane e71d4254f7 Fix trim_array() for zero-dimensional array argument.
The code tried to access ARR_DIMS(v)[0] and ARR_LBOUND(v)[0]
whether or not those values exist.  This made the range check
on the "n" argument unstable --- it might or might not fail, and
if it did it would report garbage for the allowed upper limit.
These bogus accesses would probably annoy Valgrind, and if you
were very unlucky even lead to SIGSEGV.

Report and fix by Martin Kalcher.  Back-patch to v14 where this
function was added.

Discussion: https://postgr.es/m/baaeb413-b8a8-4656-5757-ef347e5ec11f@aboutsource.net
2022-07-31 13:43:17 -04:00
..
access Fix replay of create database records on standby 2022-07-28 08:26:05 +02:00
bootstrap Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
catalog Fix omissions in support for the "regcollation" type. 2022-07-17 17:43:28 -04:00
commands Fix replay of create database records on standby 2022-07-28 08:26:05 +02:00
executor Re-add SPICleanup for ABI compatibility in stable branch 2022-07-18 16:23:48 +02:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Back-patch LLVM 14 API changes. 2022-03-16 11:42:00 +13:00
lib Fix lock assertions in dshash.c. 2022-07-11 15:47:12 +12:00
libpq Remove misguided SSL key file ownership check in libpq. 2022-05-26 14:14:05 -04:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Fix assorted missing logic for GroupingFunc nodes. 2022-03-21 17:44:29 -04:00
optimizer Fix incorrect row estimates used for Memoize costing 2022-05-16 16:08:37 +12:00
parser In transformRowExpr(), check for too many columns in the row. 2022-07-29 13:30:50 -04:00
partitioning Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:21:35 +09:00
po Translation updates 2022-06-13 07:32:39 +02:00
port Reject huge_pages=on if shared_memory_type=sysv. 2021-10-26 13:09:00 +13:00
postmaster Wake up for latches in CheckpointWriteDelay(). 2022-03-16 13:57:07 +13:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:43 -04:00
replication Prevent BASE_BACKUP in the middle of another backup in the same session. 2022-07-20 09:52:11 +09:00
rewrite Fix incautious CTE matching in rewriteSearchAndCycle(). 2022-04-23 12:16:12 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
storage Fix ReadRecentBuffer for local buffers. 2022-07-25 08:53:27 +03:00
tcop Force immediate commit after CREATE DATABASE etc in extended protocol. 2022-07-26 13:07:03 -04:00
tsearch Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
utils Fix trim_array() for zero-dimensional array argument. 2022-07-31 13:43:17 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-09-20 16:23:13 +02:00