pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PanBian <bianpan2016@163.com>
To: Michael Paquier <michael.paquier@gmail.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData()
Date: Mon, 27 Nov 2017 19:44:10 +0800
Message-ID: <20171127114410.GA30545@bp> (raw)
In-Reply-To: <CAB7nPqR0ui2hjmSTJ0PYc-YMOs_r7GX2OL9ehR07JCytxZex_w@mail.gmail.com>
References: <20171127093107.1473.70477@wrigleys.postgresql.org>
	<CAB7nPqR0ui2hjmSTJ0PYc-YMOs_r7GX2OL9ehR07JCytxZex_w@mail.gmail.com>

On Mon, Nov 27, 2017 at 07:53:30PM +0900, Michael Paquier wrote:
> On Mon, Nov 27, 2017 at 6:31 PM,  <bianpan2016@163.com> 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.

You are right. Its my carelessness. ReadDir will not return back on a
NULL dir parameter. The code is bug free. Sorry for the trouble.

Thank you all,
Pan Bian

> -- 
> Michael





view thread (10+ messages)  latest in thread

Message-ID: <20171127114410.GA30545@bp>
Permalink:  ../20171127114410.GA30545@bp/
Also on:    postgresql.org/message-id/20171127114410.GA30545@bp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: bianpan2016@163.com, michael.paquier@gmail.com, Langote_Amit_f8@lab.ntt.co.jp
  Subject: Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData()
  In-Reply-To: <20171127114410.GA30545@bp>
  References: <20171127093107.1473.70477@wrigleys.postgresql.org> <CAB7nPqR0ui2hjmSTJ0PYc-YMOs_r7GX2OL9ehR07JCytxZex_w@mail.gmail.com> <20171127114410.GA30545@bp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox