agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix pfree crash in pg_get_role_ddl() and pg_get_database_ddl().
Date: Tue, 14 Apr 2026 22:51:08 +0000
Message-ID: <E1wCmb6-0010Er-0R@gemulon.postgresql.org> (raw)
Fix pfree crash in pg_get_role_ddl() and pg_get_database_ddl().
DatumGetArrayTypeP() can return a pointer into the tuple when the
datum is stored as a short varlena, so pfree() on the result crashes.
Use DatumGetArrayTypePCopy() to always get a palloc'd copy.
Bug introduced in 76e514ebb4b and a4f774cf1c7.
Reported-by: Jeff Davis <pgsql@j-davis.com>
Author: Satya Narlapuram <satya.narlapuram@gmail.com>
Discussion: https://postgr.es/m/CAHg+QDdWtv9PKtPZEokwGCNtbv4MVnfYw5wMZrsEj4xizSNe5Q@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/1f108fc02ece09da5773ece74e25812cb952ebfc
Modified Files
--------------
src/backend/utils/adt/ddlutils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Message-ID: <E1wCmb6-0010Er-0R@gemulon.postgresql.org>
Permalink: ../E1wCmb6-0010Er-0R@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wCmb6-0010Er-0R@gemulon.postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: andrew@dunslane.net, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix pfree crash in pg_get_role_ddl() and pg_get_database_ddl().
In-Reply-To: <E1wCmb6-0010Er-0R@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox