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

Re: write past chunk end in ExprContext / to_char

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: write past chunk end in ExprContext / to_char
Date: 2007-06-29 02:41:14
Message-ID: 200706290241.l5T2fEv12994@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane wrote:
> Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)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.

Agreed from personal experience.  I am in there wacking it around it
seems every release.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-06-29 02:49:20
Subject: Re: 'SET LOCAL ROLE blah;' doesn't work?
Previous:From: Tom LaneDate: 2007-06-29 02:29:47
Subject: Re: AutoVacuum Behaviour Question

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