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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy