pgsql: Another round of Coverity fixes - Mailing list pgsql-committers

From Stephen Frost
Subject pgsql: Another round of Coverity fixes
Date
Msg-id E1WKO92-0008Pq-4X@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Stephen Frost
Date:
Subject: pgsql: Various Coverity-spotted fixes
Next
From: Robert Haas
Date:
Subject: pgsql: Define LSNOID in pg_type.h.