[COMMITTERS] pgsql: Avoid improbable null pointer dereference inpgpassfileWarning() - Mailing list pgsql-committers

From Tom Lane
Subject [COMMITTERS] pgsql: Avoid improbable null pointer dereference inpgpassfileWarning()
Date
Msg-id E1cZS43-0007Ee-W3@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Avoid improbable null pointer dereference in pgpassfileWarning().

Coverity complained that we might pass a null pointer to strcmp()
if PQresultErrorField were to return NULL.  That shouldn't be possible,
since the server is supposed to always provide some SQLSTATE or other
in an error message.  But we usually defend against such hazards, and
it only takes a little more code to do so here.

There's no good reason to think this is a live bug, so no back-patch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8ac0365c22f20dcd2a6b6752b95b665ada83e858

Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Fix placement of initPlans when forcibly materializing asubplan
Next
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Clean up psql's behavior for a few more control variables.