Re: 7.2 fe-exec.c patch to PQescapeString()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 7.2 fe-exec.c patch to PQescapeString()
Дата
Msg-id 23604.1018075307@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 7.2 fe-exec.c patch to PQescapeString()  (Ed Loehr <pgpatches@bluepolka.net>)
Список pgsql-patches
Ed Loehr <pgpatches@bluepolka.net> writes:
> They get occasional unexpected results?  Your point is well-taken
> regarding masking programming errors, but guarding against a null
> ptr crash is not 'masking the error'

I agree with Bruce on this one.  I think the right analogy is not
one of "let's be friendly if he passes a null pointer" but "should
we try to detect a bogus input pointer".  If we are passed a random
bit-pattern for the 'from' pointer, we will almost certainly core
dump on trying to dereference it.  We have no reasonable or portable
way to defend against that.  I tend to think that being passed a null
pointer is a member of this class of events, not something that we
should have a special-case defense against.  It is a caller bug and
the caller should fix it, just the same as if the caller passed us
a bogus non-null pointer.

            regards, tom lane

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

Предыдущее
От: Ed Loehr
Дата:
Сообщение: Re: 7.2 fe-exec.c patch to PQescapeString()
Следующее
От: Ed Loehr
Дата:
Сообщение: Re: 7.2 fe-exec.c patch to PQescapeString()