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

Commit52c6c0f

Browse files
committed
Avoid possible overflow with ltsGetFreeBlock() in logtape.c
nFreeBlocks, defined as a long, stores the number of free blocks in alogical tape. ltsGetFreeBlock() has been using an int to store thevalue of nFreeBlocks, which could lead to overflows on platforms wherelong and int are not the same size (in short everything except Windowswhere long is 4 bytes).The problematic intermediate variable is switched to be a long insteadof an int.Issue introduced byc02fdc9, so backpatch down to 13.Author: Ranier vilelaReviewed-by: Peter Geoghegan, David RowleyDiscussion:https://postgr.es/m/CAEudQApLDWCBR_xmwNjGBrDo+f+S4E87x3s7-+hoaKqYdtC4JQ@mail.gmail.comBackpatch-through: 13
1 parent9b581c5 commit52c6c0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/utils/sort/logtape.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ ltsGetFreeBlock(LogicalTapeSet *lts)
372372
{
373373
long*heap=lts->freeBlocks;
374374
longblocknum;
375-
intheapsize;
375+
longheapsize;
376376
longholeval;
377377
unsigned longholepos;
378378

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp