Re: Avoid possible dereference null pointer (contrib/postgres_fdw/postgres_fdw.c)
От | Etsuro Fujita |
---|---|
Тема | Re: Avoid possible dereference null pointer (contrib/postgres_fdw/postgres_fdw.c) |
Дата | |
Msg-id | CAPmGK14X_zpZu+pBvbTuA=WtdJOrFnO-qQU1vdyDz54_Njbs5Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Avoid possible dereference null pointer (contrib/postgres_fdw/postgres_fdw.c) (Fujii Masao <masao.fujii@oss.nttdata.com>) |
Ответы |
Re: Avoid possible dereference null pointer (contrib/postgres_fdw/postgres_fdw.c)
|
Список | pgsql-hackers |
Hi, On Tue, Jun 17, 2025 at 2:38 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote: > adjust_foreign_grouping_path_cost(root, pathkeys, > retrieved_rows, width, > - fpextra->limit_tuples, > + fpextra ? fpextra->limit_tuples: 0.0, > &disabled_nodes, > &startup_cost, &run_cost); > > I couldn't find a query that would reach this code path with > fpextra == NULL, but I agree the current code is fragile. > So I think it's a good idea to add the check before accessing > the field. We get here only when called from add_foreign_ordered_paths() or add_foreign_final_paths(), in which cases fpextra is always set, so it cannot be NULL. No? Best regards, Etsuro Fujita
В списке pgsql-hackers по дате отправления: