Unchecked strdup leading to segfault in pg_dump
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-12-20T14:52:56Z
Lists: pgsql-hackers
Attachments
- pg_dump_strdup.diff (application/octet-stream) patch
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
Commits
-
Fix unchecked return value from strdup
- 5b5db413d26f 16.2 landed
- 30e54d5c5d8f 17.0 landed