Re: BUG #14929: Unchecked AllocateDir() return value inrestoreTwoPhaseData()

Поиск
Список
Период
Сортировка
Искать
От
Amit Langote
Тема
Re: BUG #14929: Unchecked AllocateDir() return value inrestoreTwoPhaseData()
Дата
Msg-id
9ac0d6ec-4ef7-4864-b141-985bb84fdc1a@lab.ntt.co.jp
Ответ на
Список
Дерево обсуждения
BUG #14929: Unchecked AllocateDir() return value inrestoreTwoPhaseData() bianpan2016@163.com
Re: BUG #14929: Unchecked AllocateDir() return value inrestoreTwoPhaseData() Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData() Michael Paquier <michael.paquier@gmail.com>
Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData() Michael Paquier <michael.paquier@gmail.com>
Re: BUG #14929: Unchecked AllocateDir() return value inrestoreTwoPhaseData() PanBian <bianpan2016@163.com>
Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData() Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData() Michael Paquier <michael.paquier@gmail.com>
Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData() Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #14929: Unchecked AllocateDir() return value inrestoreTwoPhaseData() Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData() Michael Paquier <michael.paquier@gmail.com>
On 2017/11/27 19:53, Michael Paquier wrote:
> On Mon, Nov 27, 2017 at 6:31 PM,   wrote:
>> AllocateDir() will return a NULL pointer if it fails to open the specified
>> directory. However, in function restoreTwoPhaseData(), its return value is
>> not checked. This may result in a NULL pointer dereference when trying to
>> free it (see line 1759).
> 
> You are missing the fact that ReadDir goes through ReadDirExtended,
> which drops an ERROR log if the folder allocated is NULL.

I noticed that too, but isn't possible that elevel might be such that we
end up returning to restoreTwoPhaseData() after all and hit the line in it
that will then dereference the NULL cldir?  Maybe, that never happens
because, elevel is never less than ERROR in that code path?

Thanks,
Amit


В списке pgsql-bugs по дате отправления
От: Michael Paquier
Дата:
От: Michael Paquier
Дата:
FAQ