You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/02/29 12:33:05 UTC

DO NOT REPLY [Bug 51623] AgileDecryptor cycles

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

Yegor Kozlov <ye...@dinom.ru> changed:

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

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org