poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59058] OOM when parsing docx after OPCPackage.open with File but not with InputStream (TIKA-1866)
Date Wed, 24 Feb 2016 13:31:38 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=59058

--- Comment #6 from Tim Allison <tallison@mitre.org> ---
I reused Dominik's test on 57031.

If we use xerces instead of piccolo, we don't appear to have a problem with
parsing either 57031 or 59058.

This leads to an OOM for both files:
        ZipFile zf = new ZipFile(path0.toAbsolutePath().toString());
        ZipEntry entry = zf.getEntry("word/document.xml");
        DocumentDocument document =
DocumentDocument.Factory.parse(zf.getInputStream(entry));
        assertNotNull(document);

This works for both files:
        ZipFile zf = new ZipFile(path1.toAbsolutePath().toString());
        ZipEntry entry = zf.getEntry("word/document.xml");
        XMLInputFactory xmlif = XMLInputFactory.newInstance();
        XMLStreamReader reader =
xmlif.createXMLStreamReader(zf.getInputStream(entry));
        DocumentDocument document = DocumentDocument.Factory.parse(reader);
        assertNotNull(document);
        zf.close();

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message