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

Re: PG_RETURN_TEXT_P crash server process

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: PG_RETURN_TEXT_P crash server process
Date: 2002-11-12 13:11:45
Message-ID: 23276.1037106705@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz> writes:
> I found some problem with PG_RETURN_TEXT_P.

Fix your code to not scribble on memory that doesn't belong to it,
and all will be well.  I can see at least two buffer-overrun bugs,
and there may be more:

      txtn = (text *) palloc (ma);	-- forgot to add VARHDRSZ

  strcpy (*str_pointer, str);		-- copies one byte too many

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Pavel StehuleDate: 2002-11-12 13:33:14
Subject: Re: PG_RETURN_TEXT_P crash server process
Previous:From: Pavel StehuleDate: 2002-11-12 08:06:59
Subject: PG_RETURN_TEXT_P crash server process

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