Re: write past chunk end in ExprContext / to_char - Mailing list pgsql-hackers

From Tom Lane
Subject Re: write past chunk end in ExprContext / to_char
Date
Msg-id 17853.1183057778@sss.pgh.pa.us
Whole thread Raw
In response to write past chunk end in ExprContext / to_char  (Patrick Welche <prlw1@newn.cam.ac.uk>)
Responses Re: write past chunk end in ExprContext / to_char
Re: write past chunk end in ExprContext / to_char
List pgsql-hackers
Patrick Welche <prlw1@newn.cam.ac.uk> writes:
> With today's CVS code (originally noticed with 8.2beta3), on a PC where
> INT_MAX=0x7FFFFFFF=2147483647

> postgres=# select to_char(2147483648,'999,999,999');
> WARNING:  detected write past chunk end in ExprContext 0x845509c
> WARNING:  detected write past chunk end in ExprContext 0x845509c

Yech ... it's scribbling on the output of int8out, which is bad enough,
but it's assuming that buffer will be long enough when it demonstrably
isn't.

Some days I think we ought to throw out formatting.c and rewrite it from
scratch; it's probably the most poorly-coded module in all of Postgres.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: write past chunk end in ExprContext / to_char
Next
From: Tom Lane
Date:
Subject: Re: SetBufferCommitInfoNeedsSave and race conditions