Re: cube output function can overrun its buffer - Mailing list pgsql-bugs

From Tom Lane
Subject Re: cube output function can overrun its buffer
Date
Msg-id 3893.1029701837@sss.pgh.pa.us
Whole thread Raw
In response to cube output function can overrun its buffer  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-bugs
Bruno Wolff III <bruno@wolff.to> writes:
> In cube_out 100 bytes are allocated to hold the output string.

Good point.

> Instead
> using a bound on the size of g format output and separation characters,
> this bound times twice the dimension (possibly plus a small constant for
> parens and terminating 0 byte) should be used.

I made it use an expandable buffer, instead.  Much less fragile...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bruno Wolff III
Date:
Subject: cube output function can overrun its buffer
Next
From: Ian Grant
Date:
Subject: initdb fails on ia64 SMP system