Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit30e54d5

Browse files
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 beforedereferencing it. Fix by using pg_strdup() instead which probablywas 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.seBackpatch-through: 16
1 parentdc21234 commit30e54d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/bin/pg_dump/compress_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ InitDiscoverCompressFileHandle(const char *path, const char *mode)
249249

250250
Assert(strcmp(mode,PG_BINARY_R)==0);
251251

252-
fname=strdup(path);
252+
fname=pg_strdup(path);
253253

254254
if (hasSuffix(fname,".gz"))
255255
compression_spec.algorithm=PG_COMPRESSION_GZIP;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp