Re: Avoid possible deference NULL pointer (src/backend/optimizer/path/allpaths.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Avoid possible deference NULL pointer (src/backend/optimizer/path/allpaths.c)
Date
Msg-id CAEudQApjXyvo3xx9Lyig=iJKmFDMyrQOVUJKiZ7UVTACHxORfw@mail.gmail.com
Whole thread Raw
In response to Re: Avoid possible deference NULL pointer (src/backend/optimizer/path/allpaths.c)  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
List pgsql-hackers
Em qua., 5 de fev. de 2025 às 14:09, Ilia Evdokimov <ilya.evdokimov@tantorlabs.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

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Feature Request: Add AES-128-CFB Mode Support to pgcrypto
Next
From: Bertrand Drouvot
Date:
Subject: Re: Failed assertion with jit enabled