From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-committers(at)lists(dot)postgresql(dot)org |
Cc: | Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com> |
Subject: | Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() |
Date: | 2024-05-26 21:33:27 |
Message-ID: | 77a35cd9-5a68-47db-8ded-895d262f5d70@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2024-05-26 21:40:53 | pgsql: Fix meson uuid header check so it works with MSVC |
Previous Message | Michael Paquier | 2024-05-26 11:58:46 | pgsql: Fix potential NULL pointer dereference in getIdentitySequence() |