Re: BUG #16951: pg_restore segfaults on custom format piped from a different version of PG

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16951: pg_restore segfaults on custom format piped from a different version of PG
Дата
Msg-id 3413025.1617291573@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #16951: pg_restore segfaults on custom format piped from a different version of PG  (Sergey KOPOSOV <Sergey.Koposov@ed.ac.uk>)
Список pgsql-bugs
Sergey KOPOSOV <Sergey.Koposov@ed.ac.uk> writes:
> Importantly This requires running pg_restore without '-Fc' flag, i.e. to let it autodetect.

> $ cat /tmp/xx1.short | ./src/bin/pg_dump/pg_restore
> Segmentation fault (core dumped)
> $ cat /tmp/xx1.short | ./src/bin/pg_dump/pg_restore  -Fc
> pg_restore: [archiver] unsupported version (1.14) in file header

Ooooh ... the autodetect + cant-seek code path is just broken.  All of the
sanity checks on the first few fields of the file --- particularly the
version number --- just get skipped in this scenario.

I wonder why it's a good idea to read-ahead any of those fields in the
first place.  Checking the PGDMP magic string seems sufficient.

Will fix, thanks for the report!

            regards, tom lane



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

Предыдущее
От: Sergey KOPOSOV
Дата:
Сообщение: Re: BUG #16951: pg_restore segfaults on custom format piped from a different version of PG
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16951: pg_restore segfaults on custom format piped from a different version of PG