Re: pgsql: Add new escaping functions PQescapeLiteral and

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Add new escaping functions PQescapeLiteral and
Дата
Msg-id 10384.1264095443@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pgsql: Add new escaping functions PQescapeLiteral and  (rhaas@postgresql.org (Robert Haas))
Ответы Re: pgsql: Add new escaping functions PQescapeLiteral and  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-committers
rhaas@postgresql.org (Robert Haas) writes:
> Add new escaping functions PQescapeLiteral and PQescapeIdentifier.

Minor gripe: this loop test is unsafe:

+     /* Scan the string for characters that must be escaped. */
+     for (s = str; *s != '\0' && (s - str) < len; ++s)

Should check len first, else you might be fetching a byte that isn't
there.

On a stylistic level, shouldn't as_ident be declared bool not int?

            regards, tom lane

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

Предыдущее
От: rhaas@postgresql.org (Robert Haas)
Дата:
Сообщение: pgsql: Add new escaping functions PQescapeLiteral and
Следующее
От: Robert Haas
Дата:
Сообщение: Re: pgsql: Add new escaping functions PQescapeLiteral and