pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix potential NULL-pointer dereference.
6+ messages / 4 participants
[nested] [flat]

* pgsql: Fix potential NULL-pointer dereference.
@ 2014-11-10 20:30 Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Robert Haas @ 2014-11-10 20:30 UTC (permalink / raw)
  To: pgsql-committers

Fix potential NULL-pointer dereference.

Commit 2781b4bea7db357be59f9a5fd73ca1eb12ff5a79 arranged to defer
the setup of after-trigger-related data structures, but
AfterTriggerPendingOnRel didn't get the memo.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c8df9477f8ce48b202de989984f90dd78e1bba31

Modified Files
--------------
src/backend/commands/trigger.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix potential NULL pointer dereference in getIdentitySequence()
@ 2024-05-26 11:58 Michael Paquier <michael@paquier.xyz>
  2024-05-26 21:33 ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Michael Paquier @ 2024-05-26 11:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8285b484a47d829a29fbe0ebe65cdc9f9dfb179d

Modified Files
--------------
src/backend/catalog/pg_depend.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence()
  2024-05-26 11:58 pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Michael Paquier <michael@paquier.xyz>
@ 2024-05-26 21:33 ` Andrew Dunstan <andrew@dunslane.net>
  2024-05-26 21:51   ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Andrew Dunstan @ 2024-05-26 21:33 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; pgsql-committers@lists.postgresql.org; +Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>


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






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence()
  2024-05-26 11:58 pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Michael Paquier <michael@paquier.xyz>
  2024-05-26 21:33 ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Andrew Dunstan <andrew@dunslane.net>
@ 2024-05-26 21:51   ` Tom Lane <tgl@sss.pgh.pa.us>
  2024-05-26 22:43     ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2024-05-26 21:51 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Andres Freund <andres@anarazel.de>; Michael Paquier <michael@paquier.xyz>; pgsql-committers@lists.postgresql.org, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>

Andrew Dunstan <andrew@dunslane.net> writes:
> On 2024-05-26 Su 07:58, Michael Paquier wrote:
>> Fix potential NULL pointer dereference in getIdentitySequence()

> This appears to have upset a number of buildfarm members

It's hard to see how that patch would have broken "configure",
and besides that the failures started earlier.

What it looks like from here is that Andres messed up the
installed-packages set on a lot of his animals.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence()
  2024-05-26 11:58 pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Michael Paquier <michael@paquier.xyz>
  2024-05-26 21:33 ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Andrew Dunstan <andrew@dunslane.net>
  2024-05-26 21:51   ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Tom Lane <tgl@sss.pgh.pa.us>
@ 2024-05-26 22:43     ` Andrew Dunstan <andrew@dunslane.net>
  2024-05-26 23:35       ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 6+ messages in thread

From: Andrew Dunstan @ 2024-05-26 22:43 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andres Freund <andres@anarazel.de>; Michael Paquier <michael@paquier.xyz>; pgsql-committers@lists.postgresql.org, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>


On 2024-05-26 Su 17:51, Tom Lane wrote:
> Andrew Dunstan<andrew@dunslane.net>  writes:
>> On 2024-05-26 Su 07:58, Michael Paquier wrote:
>>> Fix potential NULL pointer dereference in getIdentitySequence()
>> This appears to have upset a number of buildfarm members
> It's hard to see how that patch would have broken "configure",
> and besides that the failures started earlier.
>
> What it looks like from here is that Andres messed up the
> installed-packages set on a lot of his animals.
>
> 		


Oops, sorry for the noise. I just looked at a few failures and this was 
what I saw.

cheers

andrew

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

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence()
  2024-05-26 11:58 pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Michael Paquier <michael@paquier.xyz>
  2024-05-26 21:33 ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Andrew Dunstan <andrew@dunslane.net>
  2024-05-26 21:51   ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Tom Lane <tgl@sss.pgh.pa.us>
  2024-05-26 22:43     ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Andrew Dunstan <andrew@dunslane.net>
@ 2024-05-26 23:35       ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2024-05-26 23:35 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Andres Freund <andres@anarazel.de>; pgsql-committers@lists.postgresql.org, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>

On Sun, May 26, 2024 at 06:43:50PM -0400, Andrew Dunstan wrote:
> Oops, sorry for the noise. I just looked at a few failures and this was what
> I saw.

Thanks for the heads-up.  I saw the failures before your message,
panicked at first, and then noticed that it was unrelated.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2024-05-26 23:35 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-11-10 20:30 pgsql: Fix potential NULL-pointer dereference. Robert Haas <rhaas@postgresql.org>
2024-05-26 11:58 pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Michael Paquier <michael@paquier.xyz>
2024-05-26 21:33 ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Andrew Dunstan <andrew@dunslane.net>
2024-05-26 21:51   ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Tom Lane <tgl@sss.pgh.pa.us>
2024-05-26 22:43     ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Andrew Dunstan <andrew@dunslane.net>
2024-05-26 23:35       ` Re: pgsql: Fix potential NULL pointer dereference in getIdentitySequence() Michael Paquier <michael@paquier.xyz>

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