pgsql: Guard against null plan pointer in CachedPlanIsSimplyValid().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Guard against null plan pointer in CachedPlanIsSimplyValid().
Дата
Msg-id E1qMYJk-000UQL-Qj@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Guard against null plan pointer in CachedPlanIsSimplyValid().

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/10fd061bbc66351bb9cdfc20b65d0c928620e21c

Modified Files
--------------
src/backend/utils/cache/plancache.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: pgsql: Revert "Add notBefore and notAfter to SSL cert info display"
Следующее
От: Michael Paquier
Дата:
Сообщение: pgsql: Fix worker_spi when launching workers without shared_preload_lib