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

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)timescale(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:52:20
Message-ID: CAEudQAqjQUh_gQz-=1Fx-TTFGs8SSajn+sjYOy0iac2fdRmYAQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Aleksander.

Em ter., 17 de jun. de 2025 às 09:35, Aleksander Alekseev <
aleksander(at)timescale(dot)com> escreveu:

> 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?
>
IMO, I think no.

In all paths, this check is done, why would this be the only exception?

best regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-06-17 12:55:45 Re: wrong comments in rewriteTargetListIU
Previous Message Tatsuo Ishii 2025-06-17 12:41:31 Re: BackendKeyData is mandatory?