From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.
Date: Sun, 01 Nov 2020 16:27:17 +0000
Message-ID: <E1kZGCL-0001PL-Rf@gemulon.postgresql.org> (raw)
Avoid null pointer dereference if error result lacks SQLSTATE.
Although error results received from the backend should always have
a SQLSTATE field, ones generated by libpq won't, making this code
vulnerable to a crash after, say, untimely loss of connection.
Noted by Coverity.
Oversight in commit 403a3d91c. Back-patch to 9.5, as that was.
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/d1ac060e63961fc6d5eadd27729ff29d5a52f9f1
Modified Files
--------------
src/bin/pg_dump/pg_backup_db.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Avoid null pointer dereference if error result lacks SQLSTATE.
In-Reply-To: <E1kZGCL-0001PL-Rf@gemulon.postgresql.org>
References: <E1kZGCL-0001PL-Rf@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox