pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix assign_record_type_typmod().
Date: Sat, 10 Jul 2021 17:44:26 +0000
Message-ID: <E1m2H1e-0001ve-1C@gemulon.postgresql.org> (raw)

Fix assign_record_type_typmod().

If an error occurred in the wrong place, it was possible to leave an
unintialized entry in the hash table, leading to a crash. Fixed.

Also, be more careful about the order of operations so that an
allocation error doesn't leak memory in CacheMemoryContext or
unnecessarily advance NextRecordTypmod.

Backpatch through version 11. Earlier versions (prior to 35ea75632a5)
do not exhibit the problem, because an uninitialized hash entry
contains a valid empty list.

Author: Sait Talha Nisanci <Sait.Nisanci@microsoft.com>
Reviewed-by: Andres Freund
Discussion: https://postgr.es/m/HE1PR8303MB009069D476225B9A9E194B8891779@HE1PR8303MB0090.EURPRD83.prod.outlook.c...
Backpatch-through: 11

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/52c168db955d4a3df79c41fc9da7f8b0de784305

Modified Files
--------------
src/backend/utils/cache/typcache.c | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)



view thread (5+ messages)

Message-ID: <E1m2H1e-0001ve-1C@gemulon.postgresql.org>
Permalink:  ../E1m2H1e-0001ve-1C@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m2H1e-0001ve-1C@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: jdavis@postgresql.org
  Subject: Re: pgsql: Fix assign_record_type_typmod().
  In-Reply-To: <E1m2H1e-0001ve-1C@gemulon.postgresql.org>
  References: <E1m2H1e-0001ve-1C@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