pgsql: Avoid multiple free_struct_lconv() calls on same data.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Avoid multiple free_struct_lconv() calls on same data.
Дата
Msg-id E1aaFdg-0001rW-0G@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid multiple free_struct_lconv() calls on same data.

A failure partway through PGLC_localeconv() led to a situation where
the next call would call free_struct_lconv() a second time, leading
to free() on already-freed strings, typically leading to a core dump.
Add a flag to remember whether we need to do that.

Per report from Thom Brown.  His example case only provokes the failure
as far back as 9.4, but nonetheless this code is obviously broken, so
back-patch to all supported branches.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/47792639c3e320e8596205cb8a404bac1518e1de

Modified Files
--------------
src/backend/utils/adt/pg_locale.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Avoid multiple free_struct_lconv() calls on same data.
Следующее
От: Dean Rasheed
Дата:
Сообщение: pgsql: Fix incorrect varlevelsup in security_barrier_replace_vars().