Re: Unchecked strdup leading to segfault in pg_dump - Mailing list pgsql-hackers

From Tristan Partin
Subject Re: Unchecked strdup leading to segfault in pg_dump
Date
Msg-id CXT9VSTJBTZG.284W25B3BM113@neon.tech
Whole thread Raw
In response to Unchecked strdup leading to segfault in pg_dump  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Unchecked strdup leading to segfault in pg_dump
List pgsql-hackers
On Wed Dec 20, 2023 at 8:52 AM CST, Daniel Gustafsson wrote:
> While looking at something else I noticed that pg_dump performs strdup without
> checking the returned pointer, which will segfault in hasSuffix() in case of
> OOM.  The attached, which should be backpatched to 16, changes to using
> pg_strdup instead which handles it.

Looks good to me.

--
Tristan Partin
Neon (https://neon.tech)



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: introduce dynamic shared memory registry
Next
From: Peter Eisentraut
Date:
Subject: Re: Remove MSVC scripts from the tree