pgsql: Guard against null arguments in binary_upgrade_create_empty_exte - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Guard against null arguments in binary_upgrade_create_empty_exte
Date
Msg-id E1aFqAm-0001Jv-La@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Guard against null arguments in binary_upgrade_create_empty_extension().

The CHECK_IS_BINARY_UPGRADE macro is not sufficient security protection
if we're going to dereference pass-by-reference arguments before it.

But in any case we really need to explicitly check PG_ARGISNULL for all
the arguments of a non-strict function, not only the ones we expect null
values for.

Oversight in commits 30982be4e5019684e1772dd9170aaa53f5a8e894 and
f92fc4c95ddcc25978354a8248d3df22269201bc.  Found by Andreas Seltenreich.
(The other usages in pg_upgrade_support.c seem safe.)

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ab1f08a3a4a855cb9245456866918706ca2fdf06

Modified Files
--------------
src/backend/utils/adt/pg_upgrade_support.c |   20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Guard against null arguments in binary_upgrade_create_empty_exte
Next
From: Tom Lane
Date:
Subject: pgsql: Do some copy-editing on the docs for row-level security.