Re: Possible pointer dereference

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Possible pointer dereference
Дата
Msg-id 10392.1432821575@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Possible pointer dereference  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Possible pointer dereference  (Gaetano Mendola <mendola@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, May 27, 2015 at 8:57 PM, Haribabu Kommi
> <kommi.haribabu@gmail.com> wrote:
>> By correcting the following way will solve the problem.
>> return ts ? (*ts != 0) : false; instead of retun *ts != 0;
>> Attached a patch for it.

> If the only caller always passes a valid pointer, there's no point in
> adding this check.  We have many functions in our source base that
> assume that the caller will pass a valid pointer, and changing them
> all would make the code bigger, harder to read, and possibly slower,
> without any real benefit.

Well, we should either install something like Haribabu's patch, or else
remove the existing tests in the function that allow "ts" to be NULL.
And the function's API contract comment needs to be clarified in either
case; the real bug here is lack of a specification.

I don't particularly have an opinion on whether it's valuable to allow
this function to be called without receiving a timestamp back.  Perhaps
the authors of the patch can comment on that.
        regards, tom lane



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

Предыдущее
От: Ted Toth
Дата:
Сообщение: Re: rhel6 rpm file locations
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [Proposal] More Vacuum Statistics