Re: PG_RETURN_TEXT_P crash server process

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PG_RETURN_TEXT_P crash server process
Дата
Msg-id 23276.1037106705@sss.pgh.pa.us
обсуждение исходный текст
Ответ на PG_RETURN_TEXT_P crash server process  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Ответы Re: PG_RETURN_TEXT_P crash server process  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
bug?  ("John Liu" <johnl@synthesys.com>)
Список 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 по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: PG_RETURN_TEXT_P crash server process
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: PG_RETURN_TEXT_P crash server process