Re: Avoid possible dereference null pointer (src/backend/utils/cache/relcache.c)

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid possible dereference null pointer (src/backend/utils/cache/relcache.c)
Date: 2025-06-17 12:34:48
Message-ID: CAJ7c6TOT+ccb2uuKypM5z=OPPgW07cAFzuq1EsSZb1qcpUfeHQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> The function *ScanPgRelation* can return a invalid tuple.
> It is necessary to check the function's return,
> as is already done in other parts of the source.

Good find although I'm not certain if I agree with the patch.

We would be in serious trouble if RelationReloadNailed() could be
called for a non-existing relation. Wouldn't Assert() be more
appropriate?

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2025-06-17 12:41:31 Re: BackendKeyData is mandatory?
Previous Message Dimitrios Apostolou 2025-06-17 12:32:48 --enable-{debug,cassert} should also activate --enable-depend