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

Commit720e529

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 parentd35ea27 commit720e529

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
@@ -567,7 +567,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
567567
BrinOpaque*opaque;
568568
BlockNumbernblocks;
569569
BlockNumberheapBlk;
570-
inttotalpages=0;
570+
int64totalpages=0;
571571
FmgrInfo*consistentFn;
572572
MemoryContextoldcxt;
573573
MemoryContextperRangeCxt;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp