pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix unchecked return value from strdup
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix unchecked return value from strdup
@ 2023-12-20 21:49  Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Daniel Gustafsson @ 2023-12-20 21:49 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix unchecked return value from strdup

The pg_dump compression was using strdup() instead of pg_strdup()
and failed to check the returned pointer for out-of-memory before
dereferencing it. Fix by using pg_strdup() instead which probably
was the intention here in the original patch.

Backpatch to v16 where pg_dump compression was introduced.

Reviewed-by: Tristan Partin <tristan@neon.tech>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/CC661D60-6F4C-474D-B9CF-E789ACA3CEFC@yesql.se
Backpatch-through: 16

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/30e54d5c5d8fceb7287162c116961fa0627544f5

Modified Files
--------------
src/bin/pg_dump/compress_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix unchecked return value from strdup
@ 2023-12-20 21:49  Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Daniel Gustafsson @ 2023-12-20 21:49 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix unchecked return value from strdup

The pg_dump compression was using strdup() instead of pg_strdup()
and failed to check the returned pointer for out-of-memory before
dereferencing it. Fix by using pg_strdup() instead which probably
was the intention here in the original patch.

Backpatch to v16 where pg_dump compression was introduced.

Reviewed-by: Tristan Partin <tristan@neon.tech>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/CC661D60-6F4C-474D-B9CF-E789ACA3CEFC@yesql.se
Backpatch-through: 16

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5b5db413d26ff49e9fd6506258a838ba0a9ea151

Modified Files
--------------
src/bin/pg_dump/compress_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-12-20 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20 21:49 pgsql: Fix unchecked return value from strdup Daniel Gustafsson <dgustafsson@postgresql.org>
2023-12-20 21:49 pgsql: Fix unchecked return value from strdup Daniel Gustafsson <dgustafsson@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox