diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index b0ae08f9b..28c8f53b0 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 43670 - Improve HDGF ChunkV11 separator detection, and short string detection, to solve the "Negative length of ChunkHeader" problem 48617 - Optionally allow the overriding of the Locale used by DataFormatter to control how the default number and date formats should look New event based xssf text extractor (XSSFEventBasedExcelExtractor) ExtractorFactory can now be told to prefer Event Based extractors (current Excel only) on a per-thread or overall basis diff --git a/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java b/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java index 64314ee5f..595ca9ad9 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java @@ -180,6 +180,14 @@ public final class Chunk { // A Little Endian String // Starts 8 bytes into the data segment // Ends at end of data, or 00 00 + + // Ensure we have enough data + if(contents.length < 8) { + command.value = ""; + break; + } + + // Find the end point int startsAt = 8; int endsAt = startsAt; for(int j=startsAt; j