postgresql/src/backend
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
..
access Improve BRIN minmax-multi opclass test coverage 2023-07-02 10:33:38 +02:00
archive Redesign archive modules 2023-02-17 14:26:42 +09:00
backup Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
bootstrap Fix CREATE INDEX progress reporting for multi-level partitioning. 2023-03-25 15:34:03 -04:00
catalog Use named captures in Catalog::ParseHeader() 2023-06-30 09:16:27 +09:00
commands Fix oversight in handling of modifiedCols since f24523672d 2023-07-02 22:21:02 +02:00
executor Fix memory leak in Incremental Sort rescans 2023-07-02 20:03:30 +02:00
foreign Expand some more uses of "deleg" to "delegation" or "delegated". 2023-05-21 10:55:18 -04:00
jit Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
lib Fix ILIST_DEBUG build 2023-01-18 10:26:15 -08:00
libpq Pre-beta2 mechanical code beautification. 2023-06-20 09:50:43 -04:00
main Remove obsolete defense against strxfrm() bugs. 2023-04-20 13:20:14 +12:00
nodes Remove inappropriate raw_expression_tree_walker() code 2023-06-29 10:34:53 +02:00
optimizer Defend against bogus parameterization of join input paths. 2023-06-29 12:12:52 -04:00
parser Remove dependency to query text in JumbleQuery() 2023-06-28 08:59:36 +09:00
partitioning Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
po Translation updates 2023-06-26 12:02:02 +02:00
port Update copyright for 2023 2023-01-02 15:00:37 -05:00
postmaster Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
regex Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
replication Remove redundant check for fast_forward. 2023-06-30 18:31:10 +03:00
rewrite Fix typo in comment. 2023-06-16 10:17:15 +09:00
snowball Fix the install rule for snowball_create.sql. 2023-05-23 11:15:57 -04:00
statistics Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
storage Trust signalfd on illumos, again. 2023-07-02 15:28:48 +12:00
tcop Handle logical slot conflicts on standby 2023-04-08 00:05:44 -07:00
tsearch Check for interrupts and stack overflow in TParserGet(). 2023-06-24 17:18:08 -04:00
utils Error message wording improvements 2023-06-29 09:14:55 +02:00
.gitignore
Makefile Give postgres.exe the icon of other executables. 2023-06-12 07:40:38 -07:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build Add win32ver data to meson-built postgres.exe. 2023-06-12 07:40:38 -07:00
nls.mk Add missing gettext triggers 2023-05-10 13:51:51 +02:00