From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add an Assert that enum_cmp_internal() gets passed an FmgrInfo p
Date: Fri, 24 Feb 2017 03:08:44 +0000
Message-ID: <E1ch6FQ-0002Fy-Pf@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Add an Assert that enum_cmp_internal() gets passed an FmgrInfo pointer.
If someone were to try to call one of the enum comparison functions
using DirectFunctionCallN, it would very likely seem to work, because
only in unusual cases does enum_cmp_internal() need to access the
typcache. But once such a case occurred, code like that would crash
with a null pointer dereference. To make an oversight of that sort
less likely to escape detection, add a non-bypassable Assert that
fcinfo->flinfo isn't NULL.
Discussion: https://postgr.es/m/25226.1487900067@sss.pgh.pa.us
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/6d493e1a013514a6f0abb5d30d08219c1831cfec
Modified Files
--------------
src/backend/utils/adt/enum.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: Add an Assert that enum_cmp_internal() gets passed an FmgrInfo p
In-Reply-To: <E1ch6FQ-0002Fy-Pf@gemulon.postgresql.org>
References: <E1ch6FQ-0002Fy-Pf@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