https://github.com/postgres/postgres
Revision 291c0254025bb67ceedeaca8531f1b14b8aaeeff authored by Tom Lane on 20 July 2023, 18:23:46 UTC, committed by Tom Lane on 20 July 2023, 18:23:46 UTC
If both the passed-in plan pointer and plansource->gplan are
NULL, CachedPlanIsSimplyValid would think that the plan pointer
is possibly-valid and try to dereference it.  For the one extant
call site in plpgsql, this situation doesn't normally happen
which is why we've not noticed. However, it appears to be possible
if the previous use of the cached plan failed, as per report from
Justin Pryzby.  Add an extra check to prevent crashing.
Back-patch to v13 where this code was added.

Discussion: https://postgr.es/m/ZLlV+STFz1l/WhAQ@telsasoft.com
1 parent 27e9459
History
Tip revision: 291c0254025bb67ceedeaca8531f1b14b8aaeeff authored by Tom Lane on 20 July 2023, 18:23:46 UTC
Guard against null plan pointer in CachedPlanIsSimplyValid().
Tip revision: 291c025
File Mode Size
config
contrib
doc
src
.dir-locals.el -rw-r--r-- 730 bytes
.editorconfig -rw-r--r-- 183 bytes
.git-blame-ignore-revs -rw-r--r-- 8.7 KB
.gitattributes -rw-r--r-- 1.5 KB
.gitignore -rw-r--r-- 515 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.6 KB
README -rw-r--r-- 1.2 KB
README.git -rw-r--r-- 721 bytes
aclocal.m4 -rw-r--r-- 445 bytes
configure -rwxr-xr-x 569.3 KB
configure.in -rw-r--r-- 84.2 KB

README

back to top