]> granicus.if.org Git - postgresql/commit
Fix misplaced right paren bugs in pgstatfuncs.c.
authorKevin Grittner <kgrittn@postgresql.org>
Fri, 27 Dec 2013 21:41:32 +0000 (15:41 -0600)
committerKevin Grittner <kgrittn@postgresql.org>
Fri, 27 Dec 2013 21:41:32 +0000 (15:41 -0600)
commit918d74a07e5fbaa1858e89b345b4daa10c667292
treed022b675762e099e8981e311df69df304fa6f1e0
parent7016d970d0f1f3a59249a28c6148158bc47c6bd8
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.
src/backend/utils/adt/pgstatfuncs.c