pgsql: Fix unchecked return value from strdup - Mailing list pgsql-committers

From Daniel Gustafsson
Subject pgsql: Fix unchecked return value from strdup
Date
Msg-id [email protected]
Whole thread Raw
List pgsql-committers
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 <[email protected]>
Reviewed-by: Nathan Bossart <[email protected]>
Discussion: https://postgr.es/m/[email protected]
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(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pgsql: Remove MSVC scripts
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: Fix unchecked return value from strdup