diff options
Diffstat (limited to 'src/java/org/apache/poi/ddf/EscherPropertyFactory.java')
-rw-r--r-- | src/java/org/apache/poi/ddf/EscherPropertyFactory.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/ddf/EscherPropertyFactory.java b/src/java/org/apache/poi/ddf/EscherPropertyFactory.java index 3b05034caf..fe51c18c46 100644 --- a/src/java/org/apache/poi/ddf/EscherPropertyFactory.java +++ b/src/java/org/apache/poi/ddf/EscherPropertyFactory.java @@ -20,12 +20,17 @@ package org.apache.poi.ddf; import java.util.ArrayList; import java.util.List; +import org.apache.poi.util.IOUtils; import org.apache.poi.util.LittleEndian; /** * Generates a property given a reference into the byte array storing that property. */ public final class EscherPropertyFactory { + + //arbitrarily selected; may need to increase + private static final int MAX_RECORD_LENGTH = 100_000_000; + /** * Create new properties from a byte array. * @@ -64,9 +69,9 @@ public final class EscherPropertyFactory { if ( !isComplex ) { ep = new EscherSimpleProperty( propId, propData ); } else if ( propertyType == EscherPropertyMetaData.TYPE_ARRAY) { - ep = new EscherArrayProperty( propId, new byte[propData]); + ep = new EscherArrayProperty( propId, IOUtils.safelyAllocate(propData, MAX_RECORD_LENGTH)); } else { - ep = new EscherComplexProperty( propId, new byte[propData]); + ep = new EscherComplexProperty( propId, IOUtils.safelyAllocate(propData, MAX_RECORD_LENGTH)); } break; } |