https://issues.apache.org/bugzilla/show_bug.cgi?id=51623

Yegor Kozlov <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Yegor Kozlov <[email protected]> 2012-02-29 11:33:05 UTC ---
(In reply to comment #0)
> org.apache.poi.poifs.crypt.AgileDecryptor.ChunkedCipherInputStream.read(byte[],
> int, int) does not finish if there are less bytes left in the stream than
> requested by 3rd method parameter. It should also return -1 if no bytes were
> read because of end of stream.

This situation can happen when there are padding bytes and the stream is
*longer* than the actual data. Can you upload a test case that shows the
problem: I can't reproduce the problem with my MS Office 2010.

As of r1293784, POI provides Decryptor#getLength() that returns length of the
decrypted data stream. You should change your code to read this length instead
of reading to the end of the stream, it should always work.

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to