Re: generate_series for timestamptz and time zone problem

Поиск
Список
Период
Сортировка
От Gurjeet Singh
Тема Re: generate_series for timestamptz and time zone problem
Дата
Msg-id CABwTF4UDeC=On7L6Xj1pubxdM9bcGHJ1Lrnx7b4UriS0N9VHUQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: generate_series for timestamptz and time zone problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: generate_series for timestamptz and time zone problem
Список pgsql-hackers
On Mon, Jan 30, 2023 at 4:07 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Gurjeet Singh <gurjeet@singh.im> writes:
> > [ generate_series_with_timezone.v6.patch ]
>
> The cfbot isn't terribly happy with this.  It looks like UBSan
> is detecting some undefined behavior.  Possibly an uninitialized
> variable?

It was the classical case of out-of-bounds access. I was trying to
access 4th argument, even in the case where the 3-argument variant of
generate_series() was called.

Please see attached v7 of the patch. It now checks PG_NARGS() before
accessing the optional parameter.

This mistake would've been caught early if there were assertions
preventing access beyond the number of arguments passed to the
function. I'll send the assert_enough_args.patch, that adds these
checks, in a separate thread to avoid potentially confusing cfbot.

Best regards,
Gurjeet
http://Gurje.et

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: MacOS: xsltproc fails with "warning: failed to load external entity"
Следующее
От: Gurjeet Singh
Дата:
Сообщение: Assert fcinfo has enough args before allowing parameter access (was: Re: generate_series for timestamptz and time zone problem)