Re: [patch] fix dblink security hole

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [patch] fix dblink security hole
Дата
Msg-id 21818.1222048801@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [patch] fix dblink security hole  (Joe Conway <mail@joeconway.com>)
Ответы Re: [patch] fix dblink security hole
Список pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> Tom Lane wrote:
>> Uh, you're confusing the backend environment with libpq's much more
>> spartan lifestyle.  errmsg will be malloc'd and it will *not* go away
>> unless the caller free()s it.

> Yup, just figured that out. Otherwise OK with it?

Yeah.  We could make one further refinement: callers that don't care
about acquiring an error string can pass NULL for the errmsg parameter.
That tells PQconninfoParse to throw away the errmsg string anyway.
With that, the minimal case isn't much uglier than your original:
just need a NULL arg tacked onto the call.

BTW, the usual method for doing this is just to give the caller back the
errorBuf.data, not incur an additional strdup that could fail.
        regards, tom lane


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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: [patch] fix dblink security hole
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Proposal: move column defaults into pg_attribute along with attacl