Re: Plain strdup() in frontend code

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Plain strdup() in frontend code
Date: 2019-04-30 01:23:51
Message-ID: 20190430012351.GA2762@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 29, 2019 at 01:35:12PM +0000, Daniel Gustafsson wrote:
> Good point, I've updated the patch to include those as well.

I have been reviewing this patch, and the change in pg_waldump is
actually a good thing, as we could finish with a crash if strdup()
returns NULL as the pointer gets directly used, and there would be an
assertion failure in open_file_in_directory().

parseAclItem() in dumputils.c gets changed so as we would not return
false on OOM anymore. I think that the current code is a bug as
parseAclItem() should return false to the caller only on a parsing
error so the caller can get confused between the OOM on strdup() and a
parsing problem.

In short, as presented, the patch looks acceptable to me. Are there
any objections to apply it on HEAD?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2019-04-30 02:20:27 Re: Caveats from reloption toast_tuple_target
Previous Message Ashwin Agrawal 2019-04-29 23:17:41 Re: Pluggable Storage - Andres's take