From 4405fb4ffefe9445958da366c197f0144e495fb8 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Thu, 22 Sep 2016 09:24:48 +0000 Subject: [PATCH] bug 57843: add failing unit test: Word 6.0 (1993) fails with ArrayIndexOutOfBoundsException git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1761873 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/TestAllFiles.java | 1 + .../apache/poi/hwpf/usermodel/TestBugs.java | 17 +++++++++++++++++ test-data/document/57843.doc | Bin 0 -> 8192 bytes 3 files changed, 18 insertions(+) create mode 100644 test-data/document/57843.doc diff --git a/src/integrationtest/org/apache/poi/TestAllFiles.java b/src/integrationtest/org/apache/poi/TestAllFiles.java index e364c9f28a..6def523dbf 100644 --- a/src/integrationtest/org/apache/poi/TestAllFiles.java +++ b/src/integrationtest/org/apache/poi/TestAllFiles.java @@ -232,6 +232,7 @@ public class TestAllFiles { EXPECTED_FAILURES.add("spreadsheet/43493.xls"); EXPECTED_FAILURES.add("spreadsheet/46904.xls"); EXPECTED_FAILURES.add("document/Bug50955.doc"); + EXPECTED_FAILURES.add("document/57843.doc"); EXPECTED_FAILURES.add("slideshow/PPT95.ppt"); EXPECTED_FAILURES.add("openxml4j/OPCCompliance_CoreProperties_DCTermsNamespaceLimitedUseFAIL.docx"); EXPECTED_FAILURES.add("openxml4j/OPCCompliance_CoreProperties_DoNotUseCompatibilityMarkupFAIL.docx"); diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java index 6a69aab8a3..b4591ad455 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java @@ -32,11 +32,13 @@ import org.apache.poi.hwpf.model.PlexOfField; import org.apache.poi.hwpf.model.SubdocumentType; import org.apache.poi.hwpf.model.io.HWPFOutputStream; import org.apache.poi.poifs.filesystem.NPOIFSFileSystem; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.util.IOUtils; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -901,4 +903,19 @@ public class TestBugs extends TestCase HWPFDocument hwpfDocument2 = HWPFTestDataSamples.writeOutAndReadBack(hwpfDocument); assertNotNull(hwpfDocument2); } + + public void test57843() throws IOException { + try { + File f = POIDataSamples.getDocumentInstance().getFile("57843.doc"); + boolean readOnly = true; + POIFSFileSystem fs = new POIFSFileSystem(f, readOnly); + HWPFOldDocument doc = new HWPFOldDocument(fs); + assertNotNull(doc); + doc.close(); + fs.close(); + fixed("57843"); + } catch (ArrayIndexOutOfBoundsException e) { + // expected until this bug is fixed + } + } } diff --git a/test-data/document/57843.doc b/test-data/document/57843.doc new file mode 100644 index 0000000000000000000000000000000000000000..57be6c6ed1ce6efb034dad41b5ad3638f5269d36 GIT binary patch literal 8192 zcmeHM-)|g89UuQnW7=(#6igKHFlr@8(Dkrm;wB(bJ2nn!$ie*l6aUO@sPf%wsw&v$m$zPlX8srrxzul4op z&X4cU&-XiXyLW$m{G+#je(LvZ==uhmVE1>X*^$2fG29dR>lnj~;`#p0&Q96OaC>+? zMjrSWx{f1w6vK)r=1+i*f~G;A0X+$N3KW2z2GQKZ>+$!%HKy_B7-!#P8Ct`7i0;9! z88)?>^HdM^z04n9|3Q3bY!Z{+DkqMyWynuin_XoM_Qt-;M-84}<753%7&T{9U!&~2 z4(WzPYz1w|a%dvGA4aVi)px3tPd1Srqvj0vO`+rDvqf)VwS;WP)}e!D$?)`jpJ&+E z7}aFT;r}Lo@#Q~wzgKNP!zs4mtxlQnvA+!Ko8BkX%tpEG>iy?NO z=<#9Ye}?mnK^$hSlgg}bTJ$V8Qs^b@%lo+=kWg{?1A6BBiRdgrfK`a&ewNgGrx}m z-{;GHs&9ndr$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