Re: @(#)Mordred Labs advisory 0x0003: Buffer overflow in PostgreSQL (fwd)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vince Vielhaber <vev@michvhf.com>
Cc: pgsql-hackers@postgresql.org
Date: 2002-08-20T20:15:01Z
Lists: pgsql-hackers
Vince Vielhaber <vev@michvhf.com> writes:
> Where do we check that this:
> 		result = (text *) palloc(tlen);
> is even successful?

palloc elogs if it can't allocate the space; it's unlike malloc in that
respect.  I believe it also has a guard to reject requests > 1Gb, so
I think it's reasonably proof against internal arithmetic overflows.

This problem is strictly repeat's error, not palloc's.

			regards, tom lane