Re: Crash on attempt to connect to nonstarted server

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Crash on attempt to connect to nonstarted server
Date: 2010-12-16 15:39:04
Message-ID: 21548.1292513944@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> I get a crash on win32 when connecting to a server that's not started.
> In fe-connect.c, we have:

> display_host_addr = (conn->pghostaddr == NULL) &&
> (strcmp(conn->pghost, host_addr) != 0);

> In my case, conn->pghost is NULL at this point, as is
> conn->pghostaddr. Thus, it crashes in strcmp().

[ scratches head... ] I seem to remember having decided that patch was
OK because what was there before already assumed conn->pghost would be
set. Under exactly what conditions could we get this far with neither
field being set?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-12-16 15:44:23 Re: Question regarding psql or libpq
Previous Message Magnus Hagander 2010-12-16 15:34:12 Re: Question regarding psql or libpq