]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Tighten test_predtest's input checks, and improve error messages.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Jun 2024 20:45:56 +0000 (16:45 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Jun 2024 20:45:56 +0000 (16:45 -0400)
commitf1f6ded66897efbf2ee520a8213a43251398ddf2
treecf070661968a23b6bfcb042f249460071d3702c3
parent8397f161e47c0b79075e015dd963e6db30e0d7a3
Tighten test_predtest's input checks, and improve error messages.

test_predtest() neglected to consider the possibility that
SPI_plan_get_cached_plan would return NULL.  This led to a core
dump if the input (incorrectly) contains more than one SQL
command.

While here, let's expend more than zero effort on the error
message for this case and nearby ones.

Per (half of) bug #18483 from Alexander Kozhemyakin.
Back-patch to all supported branches, not because this is
very significant (it's merely test scaffolding) but to make
our world a bit safer for fuzz testing.

Discussion: https://postgr.es/m/18483-30bfff42de238000@postgresql.org
src/test/modules/test_predtest/test_predtest.c