postgresql/src
Tomas Vondra ce5aaea8cd Fix oversight in handling of modifiedCols since f24523672d
Commit f24523672d fixed a memory leak by moving the modifiedCols bitmap
into the per-row memory context. In the case of AFTER UPDATE triggers,
the bitmap is however referenced from an event kept until the end of the
query, resulting in a use-after-free bug.

Fixed by copying the bitmap into the AfterTriggerEvents memory context,
which is the one where we keep the trigger events. There's only one
place that needs to do the copy, but the memory context may not exist
yet. Doing that in a separate function seems more readable.

Report by Alexander Pyhalov, fix by me. Backpatch to 13, where the
bitmap was added to the event by commit 71d60e2aa0.

Reported-by: Alexander Pyhalov
Backpatch-through: 13
Discussion: https://postgr.es/m/acddb17c89b0d6cb940eaeda18c08bbe@postgrespro.ru
2023-07-02 22:21:02 +02:00
..
backend Fix oversight in handling of modifiedCols since f24523672d 2023-07-02 22:21:02 +02:00
bin Introduce long options in pg_archivecleanup 2023-06-30 15:47:11 +09:00
common meson: Add dependencies to perl modules to various script invocations 2023-06-09 20:12:16 -07:00
fe_utils Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
include meson: Make some Meson style more consistent with surrounding code 2023-06-29 13:06:02 +02:00
interfaces Translation updates 2023-06-26 12:02:02 +02:00
makefiles Use --strip-unneeded when stripping static libraries with GNU strip. 2023-04-20 18:12:32 -04:00
pl Translation updates 2023-06-26 12:02:02 +02:00
port Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Improve BRIN minmax-multi opclass test coverage 2023-07-02 10:33:38 +02:00
timezone Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
tools Stamp HEAD as 17devel. 2023-06-29 19:05:23 -04:00
tutorial Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in Fix prove_installcheck when used with PGXS 2023-05-05 07:09:52 +02:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00