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

Commit3650e7a

Browse files
committed
Prevent overflow for block number in buffile.c
As coded, the start block calculated by BufFileAppend() would overflowonce more than 16k files are used with a default block size. This issueexisted beforeb1e5c9f, but there's no reason not to be clean aboutit.Per report from Coverity, with a fix suggested by Tom Lane.
1 parent28f84f7 commit3650e7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/storage/file/buffile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ BufFileSize(BufFile *file)
904904
int64
905905
BufFileAppend(BufFile*target,BufFile*source)
906906
{
907-
int64startBlock=target->numFiles*BUFFILE_SEG_SIZE;
907+
int64startBlock=(int64)target->numFiles*BUFFILE_SEG_SIZE;
908908
intnewNumFiles=target->numFiles+source->numFiles;
909909
inti;
910910

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp