Re: invalid memory alloc request size with extension url_decode

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: invalid memory alloc request size with extension url_decode
Дата
Msg-id 25644.1409236513@sss.pgh.pa.us
обсуждение исходный текст
Ответ на invalid memory alloc request size with extension url_decode  (Tobias Florek <postgres@ibotty.net>)
Список pgsql-novice
Tobias Florek <postgres@ibotty.net> writes:
> for my untrained eye, the code [2] looks reasonable. it does use the
> following idiom though.

>    len = VARSIZE(in_text) - VARHDRSZ;

This would be okay except that the in_text value was extracted with
PG_GETARG_TEXT_PP rather than PG_GETARG_TEXT_P.  That allows the
value to be a short-header Datum, which this code is not prepared for.

You could either change the wrapper functions to use PG_GETARG_TEXT_P,
or fix the subroutines to use VARDATA_ANY and VARSIZE_ANY_EXHDR
when inspecting their text* arguments.

            regards, tom lane


В списке pgsql-novice по дате отправления:

Предыдущее
От: Tobias Florek
Дата:
Сообщение: Re: invalid memory alloc request size with extension url_decode
Следующее
От: Keith
Дата:
Сообщение: Re: PG 9.1 much slower than 8.2 ?