pgsql: Tighten pg_get_object_address argument checking

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Tighten pg_get_object_address argument checking
Date: 2022-09-21 13:54:51
Message-ID: E1ob0Bf-001Lsn-Dv@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Tighten pg_get_object_address argument checking

For publication schemas (OBJECT_PUBLICATION_NAMESPACE) and user
mappings (OBJECT_USER_MAPPING), pg_get_object_address() checked the
array length of the second argument, but not of the first argument.
If the first argument was too long, it would just silently ignore
everything but the first argument. Fix that by checking the length of
the first argument as well.

Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/caaef70b-a874-1088-92ef-5ac38269c33b%40enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2da8c4cff39328897aa716a0ba57bdada5aeaf6e

Modified Files
--------------
src/backend/catalog/objectaddress.c | 10 ++++++++--
src/test/regress/expected/object_address.out | 16 +++++++++++-----
src/test/regress/sql/object_address.sql | 2 +-
3 files changed, 20 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2022-09-21 14:47:59 pgsql: Improve ICU option handling in CREATE DATABASE
Previous Message Alvaro Herrera 2022-09-21 10:35:44 pgsql: Improve some GUC description strings