Re: Correctly producing array literals for prepared statements

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Correctly producing array literals for prepared statements
Дата
Msg-id 28918.1298475117@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Correctly producing array literals for prepared statements  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> On 23.02.2011 17:16, Andrew Dunstan wrote:
>> On 02/23/2011 10:09 AM, Peter Geoghegan wrote:
>>> I'm pretty sure all of the client encodings Tatsuo mentions are ASCII
>>> supersets.

>> They are not. It's precisely because they are not that they are not
>> allowed as server encodings.

> In the supported client-only encodings, the *first* byte of a multi-byte 
> character is guaranteed to have the high bit set, but the subsequent 
> bytes are not.

And to be even more specific: the problem with the client-only encodings
is that some of them allow the byte values corresponding to "\" and
other escaping-critical characters to appear as non-first bytes in a
multibyte character.  This is nasty because you have to be aware of the
encoding to do escaping correctly and not break the data.  And as soon
as the server and client don't agree on what the encoding is, you have
the potential for SQL-injection security holes, not just confused data.
        regards, tom lane


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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Correctly producing array literals for prepared statements
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Correctly producing array literals for prepared statements