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

Commitc5b60a6

Browse files
committed
Don't call fwrite() with len == 0 when writing out relcache init file.
Noticed via -fsanitize=undefined.Backpatch to all branches, for the same reasons as46ab07f.Discussion:https://postgr.es/m/20220323173537.ll7klrglnp4gn2um@alap3.anarazel.deBackpatch: 10-
1 parent6a767bc commitc5b60a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6083,7 +6083,7 @@ write_item(const void *data, Size len, FILE *fp)
60836083
{
60846084
if (fwrite(&len,1,sizeof(len),fp)!=sizeof(len))
60856085
elog(FATAL,"could not write init file");
6086-
if (fwrite(data,1,len,fp)!=len)
6086+
if (len>0&&fwrite(data,1,len,fp)!=len)
60876087
elog(FATAL,"could not write init file");
60886088
}
60896089

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp