pgsql: postgres_fdw: Add Assert to estimate_path_cost_size().

From: Etsuro Fujita <efujita(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: postgres_fdw: Add Assert to estimate_path_cost_size().
Date: 2025-07-06 08:19:27
Message-ID: E1uYKat-004wDJ-14@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

postgres_fdw: Add Assert to estimate_path_cost_size().

When estimating the cost/size of a pre-sorted path for a given upper
relation using local stats, this function dereferences the passed-in
PgFdwPathExtraData pointer without checking that it is not NULL. But
that is not a bug as the pointer is guaranteed to be non-NULL in that
case; to avoid confusion, add an Assert to ensure that it is not NULL
before dereferencing it.

Reported-by: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Author: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
Reviewed-by: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAEudQArgiALbV1akQpeZOgim7XP05n%3DbDP1%3DTcOYLA43nRX_vA%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/21c9756db6458f859e6579a6754c78154321cb39

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c | 7 +++++++
1 file changed, 7 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-07-06 23:56:02 pgsql: Fix incompatibility with libxml2 >= 2.14
Previous Message David G. Johnston 2025-07-05 14:57:01 Re: pgsql: Fix bogus grammar for a CREATE CONSTRAINT TRIGGER error