https://github.com/postgres/postgres
Revision 9cf85093b55979e7d8ccfd9d0da21ce277a2f321 authored by Tomas Vondra on 02 July 2023, 18:29:01 UTC, committed by Tomas Vondra on 02 July 2023, 20:22:31 UTC
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
1 parent 9ae7b5d
History
Tip revision: 9cf85093b55979e7d8ccfd9d0da21ce277a2f321 authored by Tomas Vondra on 02 July 2023, 18:29:01 UTC
Fix oversight in handling of modifiedCols since f24523672d
Tip revision: 9cf8509
File Mode Size
config
contrib
doc
src
.cirrus.yml -rw-r--r-- 24.3 KB
.dir-locals.el -rw-r--r-- 730 bytes
.editorconfig -rw-r--r-- 183 bytes
.git-blame-ignore-revs -rw-r--r-- 10.2 KB
.gitattributes -rw-r--r-- 1.5 KB
.gitignore -rw-r--r-- 674 bytes
COPYRIGHT -rw-r--r-- 1.2 KB
GNUmakefile.in -rw-r--r-- 4.2 KB
HISTORY -rw-r--r-- 277 bytes
Makefile -rw-r--r-- 1.8 KB
README -rw-r--r-- 1.2 KB
README.git -rw-r--r-- 721 bytes
aclocal.m4 -rw-r--r-- 365 bytes
configure -rwxr-xr-x 570.5 KB
configure.ac -rw-r--r-- 85.1 KB
meson.build -rw-r--r-- 99.6 KB
meson_options.txt -rw-r--r-- 6.1 KB

README

back to top