Re: Avoid possible deference NULL pointer (src/backend/optimizer/path/allpaths.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid possible deference NULL pointer (src/backend/optimizer/path/allpaths.c)
Date: 2025-02-05 17:31:40
Message-ID: CAEudQApjXyvo3xx9Lyig=iJKmFDMyrQOVUJKiZ7UVTACHxORfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qua., 5 de fev. de 2025 às 14:09, Ilia Evdokimov <
ilya(dot)evdokimov(at)tantorlabs(dot)com> escreveu:

> But what should we do if cheapest == NULL further? Should we return NULL
> of get_cheapest_parameterized_child_path() function?
>
> If it is, we should write it like this:
>
> if (cheapset == NULL || bms(PATH_REQ_OUTER(cheapset), required_outer))
> return cheapest;
>

I think no in this case.
If cheapset is NULL, the logic is to continue the find.
What cannot happen is passing a null pointer to bms(PATH_REQ_OUTER.

best regards,
Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-02-05 17:32:01 Re: Failed assertion with jit enabled
Previous Message Daniel Gustafsson 2025-02-05 17:28:11 Re: Feature Request: Add AES-128-CFB Mode Support to pgcrypto