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

Commite35ff65

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 parent9e596a0 commite35ff65

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
@@ -361,7 +361,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
361361
BrinOpaque*opaque;
362362
BlockNumbernblocks;
363363
BlockNumberheapBlk;
364-
inttotalpages=0;
364+
int64totalpages=0;
365365
FmgrInfo*consistentFn;
366366
MemoryContextoldcxt;
367367
MemoryContextperRangeCxt;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp