Re: Plain strdup() in frontend code - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Plain strdup() in frontend code
Date
Msg-id 20190430012351.GA2762@paquier.xyz
Whole thread Raw
In response to Re: Plain strdup() in frontend code  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Plain strdup() in frontend code
List 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

Attachment

pgsql-hackers by date:

Previous
From: Ashwin Agrawal
Date:
Subject: Re: Pluggable Storage - Andres's take
Next
From: David Rowley
Date:
Subject: Re: Caveats from reloption toast_tuple_target