Skip site navigation (1) Skip section navigation (2)

Re: Problem with setlocale (found in libecpg) [accessing a memory location after freeing it]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: Christof Petig <christof(at)petig-baender(dot)de>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Problem with setlocale (found in libecpg) [accessing a memory location after freeing it]
Date: 2001-09-29 20:15:01
Message-ID: 13272.1001794501@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Michael Meskes <meskes(at)postgresql(dot)org> writes:
> You're partially right. Standard says "This  string  may  be allocated  in
> static storage." So, yes, with your patch we are on the safe side. I just
> committed the changes.

This patch wasn't right: setlocale(LC_NUMERIC, "C") returns a string
corresponding to the *new* locale setting, not the old one.  Therefore,
while the patched code failed to dump core, it also failed to restore
the previous locale setting as intended.  I have committed an updated
version.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Ken HirschDate: 2001-09-29 20:28:00
Subject: Re: Pre-forking backend
Previous:From: Vince VielhaberDate: 2001-09-29 20:14:25
Subject: Re: Preparation for Beta

pgsql-patches by date

Next:From: Peter EisentrautDate: 2001-09-29 22:53:54
Subject: Re: More fixes for missing double quotes in the shell
Previous:From: Bruce MomjianDate: 2001-09-29 18:26:03
Subject: Re: regression tests for pgcrypto

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group