pgsql: Fix use-after-free in ri_LoadConstraintInfo

From: Amit Langote <amitlan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix use-after-free in ri_LoadConstraintInfo
Date: 2026-03-31 08:05:40
Message-ID: E1w7U6V-002H6n-0o@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix use-after-free in ri_LoadConstraintInfo

conindid was read from conForm after ReleaseSysCache(tup). Move
the read to before the release.

Introduced by commit 2da86c1ef9b5.

Per buildfarm member prion.

Discussion: https://postgr.es/m/CA+HiwqGGYjN6F2oL7yAk=hvSs-sj3TPqZ9JC9iyLkCqJadECrw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/68a8601ee9ec7285b5a3839e17360c0a9d0e52a3

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

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Langote 2026-03-31 08:08:41 Re: pgsql: Add fast path for foreign key constraint checks
Previous Message Daniel Gustafsson 2026-03-31 08:01:06 pgsql: Formalize WAL record for XLOG_CHECKPOINT_REDO