Bug 45437

Summary: WordExtractor throws OutOfMemoryError on password protected Word files
Product: POI Reporter: Zsolt Koppany <zkoppanylist>
Component: HWPFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: test data

Description Zsolt Koppany 2008-07-19 02:15:35 UTC
Using POI-3.1-final I get the stack trace below:

java.lang.OutOfMemoryError: Java heap space
    at org.apache.poi.hwpf.model.UnhandledDataStructure.<init>(UnhandledDataStructure.java:28)
    at org.apache.poi.hwpf.model.FIBFieldHandler.<init>(FIBFieldHandler.java:162)
    at org.apache.poi.hwpf.model.FileInformationBlock.fillVariableFields(FileInformationBlock.java:67)
    at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:177)
    at org.apache.poi.hwpf.extractor.WordExtractor.<init>(WordExtractor.java:56)
    at org.apache.poi.hwpf.extractor.WordExtractor.<init>(WordExtractor.java:48)
Comment 1 Zsolt Koppany 2008-07-19 02:16:57 UTC
Created attachment 22284 [details]
test data

This attachment reproduced the bug.
Comment 2 Nick Burch 2008-07-21 12:36:23 UTC
Fix applied to svn trunk. It'll now throw an org.apache.poi.EncryptedDocumentException
Comment 3 Zsolt Koppany 2008-07-21 22:36:28 UTC
Can you provide the patched class as an attachment?
Comment 4 Nick Burch 2008-07-22 03:00:20 UTC
Just grab it from svn / grab a nightly build

http://poi.apache.org/subversion.html
http://encore.torchbox.com/poi-svn-build/
Comment 5 Zsolt Koppany 2008-07-23 02:23:39 UTC
Which class(es) did you modify?