Re: PQdb() fails with coredump when PQconnectDB() passed invalid parameter.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Trevor Inns <trevor(dot)inns(at)geering(dot)biz>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: PQdb() fails with coredump when PQconnectDB() passed invalid parameter.
Date: 2004-10-01 17:36:34
Message-ID: 12706.1096652194@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Fuhr <mike(at)fuhr(dot)org> writes:
> PQdb() is returning NULL, which causes fprintf() to dump core.

It is actually documented that a failed connection might return NULL for
this, so the example code is wrong. I've corrected the examples to not
assume PQdb can be used on a failed connection.

pg_dump was doing it wrong too :-(

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Grillet 2004-10-01 21:48:52 Bug report
Previous Message Michael Fuhr 2004-10-01 15:23:12 Re: Bug in PostrgeSQL 8.0beta