Re: Error check always bypassed in tablefunc.c

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Error check always bypassed in tablefunc.c
Дата
Msg-id CAB7nPqQYFp4T7LwSBhOfO2SgH5ysATHwqubzJWmvUDb6zbdGNw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Error check always bypassed in tablefunc.c  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Error check always bypassed in tablefunc.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Jan 17, 2015 at 11:16 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> Patch is attached. Comments welcome.
So, I have been poking at this code a bit more and as the values of
the parameters are passed as-is to the SQL queries that connectby
generates internally (this is as well mentioned in the documentation
here: http://www.postgresql.org/docs/devel/static/tablefunc.html), you
can do quite fancy things by passing for example values of the type
"foo FROM table; --" or similar. Particularly, by enforcing a query
returning only one column, or NULL values I am even able to crash the
server. The interesting part is that even if compatConnectbyTupleDescs
is enabled for each level, it is still possible to crash the server by
passing for example NULL values casted to the same type, like that
'NULL::text, NULL::text; --'.
The attached patch fixes all those things, I have also enabled
compatConnectbyTupleDescs to run at each level. I'll add it to the
next CF as well to not lose track of it. This behavior has been like
that forever...
--
Michael

Вложения

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: Partitioning: issues/ideas (Was: Re: On partitioning)
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Client deadlocks when connecting via ssl