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

Commite027ee9

Browse files
committed
Fix potential integer overflow in bringetbitmap()
This function expects an "int64" as result and stores the number ofpages to add to the index scan bitmap as an "int", multiplying its finalresult by 10. For a relation large enough, this can theoreticallyoverflow if counting more than (INT32_MAX / 10) pages, knowing that thenumber of pages is upper-bounded by MaxBlockNumber.To avoid the overflow, this commit redefines "totalpages", used tocalculate the result, to be an "int64" rather than an "int".Reported-by: Evgeniy GorbanyovAuthor: James HunterDiscussion:https://www.postgresql.org/message-id/07704817-6fa0-460c-b1cf-cd18f7647041@basealt.ruBackpatch-through: 13
1 parentdc24c9a commite027ee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/access/brin/brin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
563563
BrinOpaque*opaque;
564564
BlockNumbernblocks;
565565
BlockNumberheapBlk;
566-
inttotalpages=0;
566+
int64totalpages=0;
567567
FmgrInfo*consistentFn;
568568
MemoryContextoldcxt;
569569
MemoryContextperRangeCxt;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp