pgsql: Fix misplaced right paren bugs in pgstatfuncs.c.

From: Kevin Grittner <kgrittn(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix misplaced right paren bugs in pgstatfuncs.c.
Date: 2013-12-27 21:44:18
Message-ID: E1VwfCc-0006OD-D5@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix misplaced right paren bugs in pgstatfuncs.c.

The bug would only show up if the C sockaddr structure contained
zero in the first byte for a valid address; otherwise it would
fail to fail, which is probably why it went unnoticed for so long.

Patch submitted by Joel Jacobson after seeing an article by Andrey
Karpov in which he reports finding this through static code
analysis using PVS-Studio. While I was at it I moved a definition
of a local variable referenced in the buggy code to a more local
context.

Backpatch to all supported branches.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/28b60aa231c1f5ba89495da4f84564ebd9faeeb4

Modified Files
--------------
src/backend/utils/adt/pgstatfuncs.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2013-12-27 22:21:58 pgsql: Properly detect invalid JSON numbers when generating JSON.
Previous Message Alvaro Herrera 2013-12-27 18:57:43 Re: [COMMITTERS] pgsql: Upgrade to Autoconf 2.69