From 6d760534c48bdd37dab9e4ca916fb114fa4c6f36 Mon Sep 17 00:00:00 2001 From: Scott Crosby Date: Thu, 16 Sep 2010 13:42:05 -0500 Subject: [PATCH] Allow bigger blocks before erroring out, and comment the bounds. --- src.java/crosby/binary/file/FileBlockBase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src.java/crosby/binary/file/FileBlockBase.java b/src.java/crosby/binary/file/FileBlockBase.java index 4be4efa..c549281 100644 --- a/src.java/crosby/binary/file/FileBlockBase.java +++ b/src.java/crosby/binary/file/FileBlockBase.java @@ -13,8 +13,10 @@ import com.google.protobuf.ByteString; */ public class FileBlockBase { + /** If a block header is bigger than this, fail. We use excessively large header size as an indication of corrupt files */ static final int MAX_HEADER_SIZE = 64*1024; - static final int MAX_BODY_SIZE = 8*1024*1024; + /** If a block's size is bigger than this, fail. We use excessively large block sizes as an indication of corrupt files */ + static final int MAX_BODY_SIZE = 32*1024*1024; protected FileBlockBase(String type, ByteString indexdata) { this.type = type;