Tomas Szepe <szepe@pinerecords.com> writes:
> I'm getting an ugly non-deterministic segfault in postmaster
> at aset.c:539.
> ...
> Anyone with a fix? :)
Yech. This is the *second* buffer-overrun bug we've found in to_ascii()
in the last couple months. I've now taken a close look at that whole
file and I think the rest of it is okay, but ... :-(
Patch against 7.3.3 is attached.
regards, tom lane
*** src/backend/utils/adt/ascii.c.orig Wed Apr 2 16:08:07 2003
--- src/backend/utils/adt/ascii.c Mon Jul 14 12:37:33 2003
***************
*** 94,100 ****
{
pg_to_ascii(
(unsigned char *) VARDATA(data), /* src */
! VARDATA(data) + VARSIZE(data), /* src end */
(unsigned char *) VARDATA(data), /* desc */
enc); /* encoding */
--- 94,100 ----
{
pg_to_ascii(
(unsigned char *) VARDATA(data), /* src */
! (unsigned char *) (data) + VARSIZE(data), /* src end */
(unsigned char *) VARDATA(data), /* desc */
enc); /* encoding */