pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Subject: Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence()
Date: Sun, 26 May 2024 17:33:27 -0400
Message-ID: <77a35cd9-5a68-47db-8ded-895d262f5d70@dunslane.net> (raw)
In-Reply-To: <E1sBCWU-001pvr-Ot@gemulon.postgresql.org>
References: <E1sBCWU-001pvr-Ot@gemulon.postgresql.org>


On 2024-05-26 Su 07:58, Michael Paquier wrote:
> Fix potential NULL pointer dereference in getIdentitySequence()
>
> The function invokes SearchSysCacheAttNum() and SearchSysCacheAttName().
> They may respectively return 0 for the attribute number or NULL for
> the attribute name if the attribute does not exist, without any kind of
> error handling.  The common practice is to check that the data retrieved
> from the syscache is valid.  There is no risk of NULL pointer
> dereferences currently, but let's stick to the practice of making sure
> that this data is always valid, to catch future inconsistency mistakes.
> The code is switched to use get_attnum() and get_attname(), and adds
> some error handling.
>
> Oversight in 509199587df7.
>
> Reported-by: Ranier Vilela
> Author: Ashutosh Bapat
> Discussion: https://postgr.es/m/CAEudQAqh_RZqoFcYKso5d9VhF-Vd64_ZodfQ_2zSusszkEmyRg@mail.gmail.com
>

This appears to have upset a number of buildfarm members


cheers


andrew

-- 

Andrew Dunstan
EDB: https://www.enterprisedb.com






view thread (6+ messages)  latest in thread

Message-ID: <77a35cd9-5a68-47db-8ded-895d262f5d70@dunslane.net>
Permalink:  ../77a35cd9-5a68-47db-8ded-895d262f5d70@dunslane.net/
Also on:    postgresql.org/message-id/77a35cd9-5a68-47db-8ded-895d262f5d70@dunslane.net

 · 

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, michael@paquier.xyz, pgsql-committers@lists.postgresql.org, ashutosh.bapat@enterprisedb.com
  Subject: Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence()
  In-Reply-To: <77a35cd9-5a68-47db-8ded-895d262f5d70@dunslane.net>

* 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