From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix parsePGArray() error checking in pg_dump.
Date: Mon, 09 Nov 2020 03:28:12 +0000
Message-ID: <E1kbxqm-0007c5-VB@gemulon.postgresql.org> (raw)
Fix parsePGArray() error checking in pg_dump.
Coverity complained about a defect in commit 257836a7:
Calling "parsePGArray" without checking return value (as is
done elsewhere 11 out of 13 times).
Fix, and also check for empty strings explicitly (NULL as represented by
PQgetvalue()). That worked correctly before only because parsePGArray()
happens to set *nitems = 0 when it fails on an empty string. Also
convert a sanity check assertion to an error to be more paranoid, and
pgindent a nearby line.
Reported-by: Michael Paquier <michael@paquier.xyz>
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3636efa11945af64479995609762b2626c6c319a
Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 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: tmunro@postgresql.org
Subject: Re: pgsql: Fix parsePGArray() error checking in pg_dump.
In-Reply-To: <E1kbxqm-0007c5-VB@gemulon.postgresql.org>
References: <E1kbxqm-0007c5-VB@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