| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | pgsql-committers(at)postgresql(dot)org | 
| Subject: | pgsql: Avoid multiple free_struct_lconv() calls on same data. | 
| Date: | 2016-02-29 04:40:56 | 
| Message-ID: | [email protected] | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | 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_3_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/0c4457de8b8a6aa715bdfe94ecfa8ee3d48e2827
Modified Files
--------------
src/backend/utils/adt/pg_locale.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dean Rasheed | 2016-02-29 12:42:20 | pgsql: Fix incorrect varlevelsup in security_barrier_replace_vars(). | 
| Previous Message | Tom Lane | 2016-02-29 04:40:55 | pgsql: Avoid multiple free_struct_lconv() calls on same data. |