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

Commit420c8dc

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 parenta01e479 commit420c8dc

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
@@ -389,7 +389,7 @@ ltsGetFreeBlock(LogicalTapeSet *lts)
389389
{
390390
long*heap=lts->freeBlocks;
391391
longblocknum;
392-
intheapsize;
392+
longheapsize;
393393
unsigned longpos;
394394

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp