Thread
Commits
-
Fix unchecked return value from strdup
- 5b5db413d26f 16.2 landed
- 30e54d5c5d8f 17.0 landed
-
Unchecked strdup leading to segfault in pg_dump
Daniel Gustafsson <daniel@yesql.se> — 2023-12-20T14:52:56Z
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. -- Daniel Gustafsson
-
Re: Unchecked strdup leading to segfault in pg_dump
Tristan Partin <tristan@neon.tech> — 2023-12-20T15:39:55Z
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)
-
Re: Unchecked strdup leading to segfault in pg_dump
Nathan Bossart <nathandbossart@gmail.com> — 2023-12-20T16:20:26Z
On Wed, Dec 20, 2023 at 09:39:55AM -0600, Tristan Partin wrote: > 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. +1 -- Nathan Bossart Amazon Web Services: https://aws.amazon.com