PQescapeStringConn problem

Поиск
Список
Период
Сортировка
Искать
От
Oliver Kindernay
Тема
PQescapeStringConn problem
Дата
в 14:01:29
Msg-id
AANLkTinSWLlsvTSNwoWFaXhOoHCQDCa-1g8LhekHZL4w@mail.gmail.com
Список
Дерево обсуждения
PQescapeStringConn problem Oliver Kindernay <oliver.kindernay@gmail.com>
Re: PQescapeStringConn problem Tom Lane <tgl@sss.pgh.pa.us>
Re: PQescapeStringConn problem Oliver Kindernay <oliver.kindernay@gmail.com>
Hi. I am using libpq in my C application to comunicate with database.
Application gets input from untrustworthy source and then uses it in
SQL requests. To avoid SQL injection I want to use PQescapeStringConn
function. The problem is, that i don't know how to properly use this
function.

http://www.postgresql.org/docs/7.3/static/libpq-exec.html#LIBPQ-EXEC-ESCAPE-STRING

How can I know the size of "to" buffer before I call this function? If
I don't know it it may cause heap overflow..
Can you provide some example how this function is used in other apps?
В списке pgsql-novice по дате отправления
От: Andreas Kretschmer
Дата:
От: Tom Lane
Дата:
Сообщение: Re: PQescapeStringConn problem
FAQ