Re: BUG #16330: psql accesses null pointer in connect.c:do_connect

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16330: psql accesses null pointer in connect.c:do_connect
Дата
Msg-id 17009.1585582541@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #16330: psql accesses null pointer in connect.c:do_connect  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: BUG #16330: psql accesses null pointer in connect.c:do_connect  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Mar 30, 2020 at 02:20:48AM +0000, PG Bug reporting form wrote:
>> If the connection to postmaster is closed, then trying to re-connect to
>> another one leads to SIGSEGV.

> A fix like the attached should be sufficient as if we know that
> PQhost() is NULL for the old connection we cannot use the old
> hostaddr.  Alvaro, what do you think?

It looks to me like there's a similar hazard a bit further down
(line 3029):

        appendConnStrVal(&connstr, PQdb(o_conn));

I wonder if we should force reuse_previous to false if there's
no o_conn, rather than fixing this stuff piecemeal.

            regards, tom lane



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

Предыдущее
От: Francisco Olarte
Дата:
Сообщение: Re: BUG #16321: Memory leaks in PostmasterMain
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #16330: psql accesses null pointer in connect.c:do_connect