From: Sergey Vladimirov Date: Sat, 29 Oct 2011 22:34:09 +0000 (+0000) Subject: fix 52032 - HWPF - ArrayIndexOutofBoundsException with no stack trace (broken after... X-Git-Tag: REL_3_8_BETA5~41 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bf3550b406b8888a74b352a812ce63d88721a971;p=poi.git fix 52032 - HWPF - ArrayIndexOutofBoundsException with no stack trace (broken after revision 1178063) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1195060 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index aa8117feeb..bd1d4d8926 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 52032 - HWPF - ArrayIndexOutofBoundsException with no stack trace (broken after revision 1178063) support for converting pptx files into images with a PPTX2PNG tool 52050 - Support for the Excel RATE function 51566 - HSLF fix for finishing parsing the picture stream on the first non-valid type diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/ListFormatOverrideLevel.java b/src/scratchpad/src/org/apache/poi/hwpf/model/ListFormatOverrideLevel.java index 2cc28b336d..0acd9d0c3b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/ListFormatOverrideLevel.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/ListFormatOverrideLevel.java @@ -34,6 +34,7 @@ public final class ListFormatOverrideLevel public ListFormatOverrideLevel( byte[] buf, int offset ) { _base = new LFOLVLBase( buf, offset ); + offset += LFOLVLBase.getSize(); if ( _base.isFFormatting() ) { 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 686f29706c..17e378d26a 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java @@ -719,4 +719,15 @@ public class TestBugs extends TestCase HWPFTestDataSamples.writeOutAndReadBack( HWPFTestDataSamples .openSampleFile( "Bug51834.doc" ) ); } + + /** + * Bug 52032 - [BUG] & [partial-PATCH] HWPF - ArrayIndexOutofBoundsException + * with no stack trace (broken after revision 1178063) + */ + public void testBug52032() throws Exception + { + HWPFTestDataSamples.openSampleFile( "Bug52032.doc" ); + HWPFTestDataSamples.writeOutAndReadBack( HWPFTestDataSamples + .openSampleFile( "Bug52032.doc" ) ); + } } diff --git a/test-data/document/Bug52032.doc b/test-data/document/Bug52032.doc new file mode 100644 index 0000000000..c91d240bf9 Binary files /dev/null and b/test-data/document/Bug52032.doc differ