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

Commitd0c0c89

Browse files
committed
Fix unsafe extraction of the OID part of a relation filename.
Commit8694cc9 did this randomly differently from other callers ofparse_filename_for_nontemp_relation(). Perhaps unsurprisingly,the randomly different way is wrong; it fails to ensure theextracted string is null-terminated. Per buildfarm member skink.Discussion:https://postgr.es/m/14453.1522001792@sss.pgh.pa.us
1 parentbf4a867 commitd0c0c89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/replication/basebackup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,8 @@ sendDir(const char *path, int basepathlen, bool sizeonly, List *tablespaces,
10561056
* If any other type of fork, check if there is an init fork
10571057
* with the same OID. If so, the file can be excluded.
10581058
*/
1059-
strncpy(relOid,de->d_name,relOidChars);
1059+
memcpy(relOid,de->d_name,relOidChars);
1060+
relOid[relOidChars]='\0';
10601061
snprintf(initForkFile,sizeof(initForkFile),"%s/%s_init",
10611062
path,relOid);
10621063

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp