poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 58156] New: [patch] Bug: Data corruption in hasPOIFSHeader and hasOOXMLHeader
Date Mon, 20 Jul 2015 10:48:29 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=58156

            Bug ID: 58156
           Summary: [patch] Bug: Data corruption in hasPOIFSHeader and
                    hasOOXMLHeader
           Product: POI
           Version: 3.12-FINAL
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: POIFS
          Assignee: dev@poi.apache.org
          Reporter: stefan.kopf@alfresco.com

If the InputStream has less than 4 (OOXML less than 8) bytes and is wrapped
into a PushbackInputStream, the data in this PushbackInputStream gets
corrupted.

Background:
Both methods try to read 4 (OOXML 8) bytes from the stream into a buffer and
then push back this buffer. But these methods always push back the entire
buffer, no matter how many bytes have actually been read from the stream. In
the case that the stream contains less than 4 (OOXML 8) bytes, the
PushbackInputStream is now extended to 4 (8) bytes with 0x00s.

This patch records the actual nember of bytes read from the stream only only
pushes back this ammount of bytes.

-- 
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