Re: Patch for str_numth() in PG 7.4

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch for str_numth() in PG 7.4
Date: 2009-01-13 00:50:46
Message-ID: 20090113005046.GQ4919@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andreas 'ads' Scherbaum wrote:
>
> Hello all,
>
> On Mon, 12 Jan 2009 22:55:32 +0100 Andreas 'ads' Scherbaum wrote:
>
> > I tracked the problem done to the function str_numth() in
> > src/backend/utils/adt/formatting.c. The fix (attached) is easy: i
> > stole the function code from the latest 8.0 version which looks fare
> > more sane in handling the string pointers.
>
> Now with the correct patch attached, thanks to anyone who pointed this
> out ;-)

This was fixed on 1.84 of formatting.c for 8.0 (but not backpatched for
no apparent reason), which also changed some other stuff in that file.
The complete patch is attached.

revision 1.84
date: 2005-01-12 22:40:13 -0300; author: tgl; state: Exp; lines: +9 -7;
branches: 1.84.4;
Remove unportable assumption that it's okay to use the target buffer
of an sprintf() as a source string. Demonstrably does not work with
recent gcc and/or glibc on some platforms.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment Content-Type Size
patch text/plain 2.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2009-01-13 00:54:43 Re: Documenting pglesslog
Previous Message Bruce Momjian 2009-01-13 00:30:00 Re: Recovery Test Framework