pgsql: waldump: fix use-after-free in search_directory().

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: waldump: fix use-after-free in search_directory().
Дата
Msg-id E1nYeCN-001gX8-T0@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
waldump: fix use-after-free in search_directory().

After closedir() dirent->d_name is not valid anymore. As there alerady are a
few places relying on the limited lifetime of pg_waldump, do so here as well,
and just pg_strdup() the string.

The bug was introduced in fc49e24fa69a.

Found by UBSan, run locally.

Backpatch: 11-, like fc49e24fa69 itself.

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7d935bdf7af71aaa1654366b9fd051581660326a

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: pgsql: Fix up compiler warnings/errors from f4fb45d15.
Следующее
От: Thomas Munro
Дата:
Сообщение: pgsql: Fix pg_waldump docs.