postgresql/src
Tom Lane 4ddfbd2a8e 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
..
backend Fix trim_array() for zero-dimensional array argument. 2022-07-31 13:43:17 -04:00
bin Revise test case added in 4374699639. 2022-07-29 23:24:39 -04:00
common Fix get_dirent_type() for symlinks on MinGW/MSYS. 2022-07-28 14:26:12 +12:00
fe_utils Add xheader_width pset option to psql 2022-07-25 14:25:02 -04:00
include Support pg_read_[binary_]file (filename, missing_ok). 2022-07-29 15:38:49 -04:00
interfaces Fix [install]check in interfaces/libpq/Makefile 2022-07-22 20:15:11 +02:00
makefiles Default to hidden visibility for extension libraries where possible 2022-07-17 17:49:51 -07:00
pl Add PGDLLEXPORTS to some plpgsql function declarations 2022-07-20 10:24:50 +02:00
port Remove dead getpwuid_r replacement code. 2022-07-24 09:44:29 +12:00
template Remove HP-UX port. 2022-07-08 14:05:05 +12:00
test Fix trim_array() for zero-dimensional array argument. 2022-07-31 13:43:17 -04:00
timezone Update time zone data files to tzdata release 2022a. 2022-05-05 14:54:53 -04:00
tools Split TuplesortPublic from Tuplesortstate 2022-07-27 08:28:10 +03:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Increase minimum supported GNU make version to 3.81. 2022-07-23 12:12:42 -04:00
Makefile.shlib Default to hidden visibility for extension libraries where possible 2022-07-17 17:49:51 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00