Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 72fe12d

Browse files
committed
Add check for 4Gb segment overflow in CFS
1 parent 93d08b2 commit 72fe12d

File tree

1 file changed

+4
-0
lines changed
  • src/backend/storage/file

1 file changed

+4
-0
lines changed

src/backend/storage/file/fd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,10 @@ FileWrite(File file, char *buffer, int amount)
19001900
* because we want to write all updated pages sequentially
19011901
*/
19021902
pos = cfs_alloc_page(map, CFS_INODE_SIZE(inode), compressedSize);
1903+
if (pos > pos + compressedSize) {
1904+
elog(ERROR, "CFS segment file exceeed 4Gb limit");
1905+
}
1906+
19031907
inode = CFS_INODE(compressedSize, pos);
19041908
buffer = compressedBuffer;
19051909
amount = compressedSize;

0 commit comments

Comments
 (0)