git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: bfac42e) | patch
Fix trim_array() for zero-dimensional array argument.
2022年7月31日 17:43:17 +0000 (13:43 -0400)
2022年7月31日 17:43:17 +0000 (13:43 -0400)
commit 4ddfbd2a8ea9b41ced0cad1d984c833085f8ce91
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
src/backend/utils/adt/arrayfuncs.c diff | blob | blame | history
src/test/regress/expected/arrays.out diff | blob | blame | history
src/test/regress/sql/arrays.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /