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

Commitd2bd4ba

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 parent3d895f9 commitd2bd4ba

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
@@ -391,7 +391,7 @@ ltsGetFreeBlock(LogicalTapeSet *lts)
391391
{
392392
long*heap=lts->freeBlocks;
393393
longblocknum;
394-
intheapsize;
394+
longheapsize;
395395
unsigned longpos;
396396

397397
/* freelist empty; allocate a new block */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp