pgsql: Fix crash in psql when attempting to reuse old connection

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pgsql: Fix crash in psql when attempting to reuse old connection
Дата
Msg-id E1jJWH6-0008CS-KY@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix crash in psql when attempting to reuse old connection

In a psql session, if the connection to the server is abruptly cut, the
referenced connection would become NULL as of CheckConnection().  This
could cause a hard crash with psql if attempting to connect by reusing
the past connection's data because of a null-pointer dereference with
either PQhost() or PQdb().  This issue is fixed by making sure that no
reuse of the past connection is done if it does not exist.

Issue has been introduced by 6e5f8d4, so backpatch down to 12.

Reported-by: Hugh Wang
Author: Michael Paquier
Reviewed-by: Álvaro Herrera, Tom Lane
Discussion: https://postgr.es/m/16330-b34835d83619e25d@postgresql.org
Backpatch-through: 12

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8d84dd00123985e739233fa67c9b1d555f33ed03

Modified Files
--------------
src/bin/psql/command.c | 5 +++++
1 file changed, 5 insertions(+)


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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: pgsql: Fix coverity complaint about commit 40d964ec99.
Следующее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Documentation corrections for opclass parameters