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

Commit264d284

Browse files
committed
waldump: fix use-after-free in search_directory().
After closedir() dirent->d_name is not valid anymore. As there alerady are afew places relying on the limited lifetime of pg_waldump, do so here as well,and just pg_strdup() the string.The bug was introduced infc49e24.Found by UBSan, run locally.Backpatch: 11-, likefc49e24 itself.
1 parentcc7401d commit264d284

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/bin/pg_waldump/pg_waldump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ search_directory(const char *directory, const char *fname)
204204
if (IsXLogFileName(xlde->d_name))
205205
{
206206
fd=open_file_in_directory(directory,xlde->d_name);
207-
fname=xlde->d_name;
207+
fname=pg_strdup(xlde->d_name);
208208
break;
209209
}
210210
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp