pgsql: Another round of Coverity fixes

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Another round of Coverity fixes
Date: 2014-03-03 08:22:40
Message-ID: E1WKO92-0008Pq-4X@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Another round of Coverity fixes

Additional non-security issues/improvements spotted by Coverity.

In backend/libpq, no sense trying to protect against port->hba being
NULL after we've already dereferenced it in the switch() statement.

Prevent against possible overflow due to 32bit arithmitic in
basebackup throttling (not yet released, so no security concern).

Remove nonsensical check of array pointer against NULL in procarray.c,
looks to be a holdover from 9.1 and earlier when there were pointers
being used but now it's just an array.

Remove pointer check-against-NULL in tsearch/spell.c as we had already
dereferenced it above (in the strcmp()).

Remove dead code from adt/orderedsetaggs.c, isnull is checked
immediately after each tuplesort_getdatum() call and if true we return,
so no point checking it again down at the bottom.

Remove recently added minor error-condition memory leak in pg_regress.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5592ebac55460866da867df5c783c34e3c9a7cae

Modified Files
--------------
src/backend/libpq/auth.c | 18 +++++++-----------
src/backend/replication/basebackup.c | 3 ++-
src/backend/storage/ipc/procarray.c | 9 +++------
src/backend/tsearch/spell.c | 2 +-
src/backend/utils/adt/orderedsetaggs.c | 5 +----
src/test/regress/pg_regress.c | 12 +++++++++---
6 files changed, 23 insertions(+), 26 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2014-03-03 12:05:44 pgsql: Define LSNOID in pg_type.h.
Previous Message Stephen Frost 2014-03-02 03:14:35 pgsql: Various Coverity-spotted fixes