[Bug 39526] ArrayIndexOutOfBoundsException opening Word document

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug 39526] ArrayIndexOutOfBoundsException opening Word document

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=39526

--- Comment #12 from Mr.zhang <[hidden email]> ---
I have a same problem. when i read a document of doc.
this my poi dependency.
<dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>4.1.2</version>
</dependency>
<dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>4.1.2</version>
</dependency>
<dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml-schemas</artifactId>
        <version>4.1.2</version>
</dependency>
<dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-scratchpad</artifactId>
        <version>4.1.2</version>
</dependency>

my code
InputStream is = new FileInputStream(path);
HWPFDocument doc = new HWPFDocument(is);
StringBuilder buffer = doc.getText();

the error
java.lang.ArrayIndexOutOfBoundsException: Index 65946 out of bounds for length
9355

        at org.apache.poi.util.LittleEndian.getUShort(LittleEndian.java:355)
        at
org.apache.poi.hwpf.model.FileInformationBlock.<init>(FileInformationBlock.java:118)
        at
org.apache.poi.hwpf.HWPFDocumentCore.<init>(HWPFDocumentCore.java:170)

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]