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

From Daniel Gustafsson
Subject Unchecked strdup leading to segfault in pg_dump
Date
Msg-id CC661D60-6F4C-474D-B9CF-E789ACA3CEFC@yesql.se
Whole thread Raw
Responses Re: Unchecked strdup leading to segfault in pg_dump
List pgsql-hackers
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


Attachment

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: ci: Build standalone INSTALL file
Next
From: Nathan Bossart
Date:
Subject: Re: introduce dynamic shared memory registry