Re: PG_RETURN_TEXT_P crash server process - Mailing list pgsql-bugs

From Tom Lane
Subject Re: PG_RETURN_TEXT_P crash server process
Date
Msg-id 23276.1037106705@sss.pgh.pa.us
Whole thread Raw
In response to PG_RETURN_TEXT_P crash server process  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Responses Re: PG_RETURN_TEXT_P crash server process
bug?
List pgsql-bugs
Pavel Stehule <stehule@kix.fsv.cvut.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

pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: PG_RETURN_TEXT_P crash server process
Next
From: Pavel Stehule
Date:
Subject: Re: PG_RETURN_TEXT_P crash server process