pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix bogus CALLED_AS_TRIGGER() defenses.
Date: Fri, 03 Apr 2020 15:25:16 +0000
Message-ID: <E1jKOC4-0003ak-Fn@gemulon.postgresql.org> (raw)

Fix bogus CALLED_AS_TRIGGER() defenses.

contrib/lo's lo_manage() thought it could use
trigdata->tg_trigger->tgname in its error message about
not being called as a trigger.  That naturally led to a core dump.

unique_key_recheck() figured it could Assert that fcinfo->context
is a TriggerData node in advance of having checked that it's
being called as a trigger.  That's harmless in production builds,
and perhaps not that easy to reach in any case, but it's logically
wrong.

The first of these per bug #16340 from William Crowell;
the second from manual inspection of other CALLED_AS_TRIGGER
call sites.

Back-patch the lo.c change to all supported branches, the
other to v10 where the thinko crept in.

Discussion: https://postgr.es/m/16340-591c7449dc7c8c47@postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a9f821f48893308fbb5533a1b722c233eaa2d603

Modified Files
--------------
contrib/lo/lo.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1jKOC4-0003ak-Fn@gemulon.postgresql.org>
Permalink:  ../E1jKOC4-0003ak-Fn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jKOC4-0003ak-Fn@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix bogus CALLED_AS_TRIGGER() defenses.
  In-Reply-To: <E1jKOC4-0003ak-Fn@gemulon.postgresql.org>
  References: <E1jKOC4-0003ak-Fn@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox