]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid possible longjmp-induced logic error in PLy_trigger_build_args.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 1 Apr 2024 19:15:03 +0000 (15:15 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 1 Apr 2024 19:15:03 +0000 (15:15 -0400)
commitfb60118bf233b95329dde45e55059a179ccc4fbe
tree0adf1650f299a98c8a8f625e207c66e638a94c19
parentde3c5b18729a234df0b9203e195a2a5c168ef1cd
Avoid possible longjmp-induced logic error in PLy_trigger_build_args.

The "pltargs" variable wasn't marked volatile, which makes it unsafe
to change its value within the PG_TRY block.  It looks like the worst
outcome would be to fail to release a refcount on Py_None during an
(improbable) error exit, which would likely go unnoticed in the field.
Still, it's a bug.  A one-liner fix could be to mark pltargs volatile,
but on the whole it seems cleaner to arrange things so that we don't
change its value within PG_TRY.

Per report from Xing Guo.  This has been there for quite awhile,
so back-patch to all supported branches.

Discussion: https://postgr.es/m/CACpMh+DLrk=fDv07MNpBT4J413fDAm+gmMXgi8cjPONE+jvzuw@mail.gmail.com
src/pl/plpython/plpy_exec.c