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

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Avoid possible deference NULL pointer (src/backend/optimizer/path/allpaths.c)
Date: 2025-01-04 23:29:51
Message-ID: CAEudQApsZ8sdoRsn_oE=KEwkSMjh-sgsjuGWaE6CmHwQ+3xt1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

Per Coverity.

All call sites of function *get_cheapest_path_for_pathkeys* checks
for NULL returns.

So, it is highly likely that the function will return NULL.

IMO, the Assert in this particular call, is not fully effective.

Fix removing the Assert and always check if the return is NULL.

best regards,
Ranier Vilela

Attachment Content-Type Size
fix-possible-null-dereference-allpatchs.patch application/octet-stream 584 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Filip Janus 2025-01-04 23:43:05 Re: Proposal: Adding compression of temporary files
Previous Message Filip Janus 2025-01-04 22:40:46 Re: Proposal: Adding compression of temporary files