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 2017/11/02 07:45:40 UTC

[Bug 61677] ChainLoopDetector failing with java.lang.ArrayIndexOutOfBoundsException:

https://bz.apache.org/bugzilla/show_bug.cgi?id=61677

Nick Burch <ap...@gagravarr.org> changed:

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

--- Comment #9 from Nick Burch <ap...@gagravarr.org> ---
We're moving to Java 8 for the next major release, so using
Integer.toUnsignedLong might be possible going forward. However...

I think there are some hard-baked assumptions in the code that no valid block
will be beyond 2^31 mark. If that were to change, because of the way that Java
arrays work (and we generally want to use Arrays not Maps/Sets for performance
and memory utilisation), we'd have to change some places to potentially have a
second array for the "negative signed ints" offsets

For your problematic MSG file, how big is the file itself? And are these
negative offsets occurring in the Mini Stream (small blocks) or the Normal /
Main Stream (big blocks)? Can other tools (eg OpenOffice, libgsf) read the file
ok?

The spec <https://msdn.microsoft.com/en-us/library/dd942475.aspx> suggests that
the maximum allowed size of a 512-blocksize file (eg MSG or DOC) is 2gb, so we
shouldn't be anywhere near exceeding the 2^31 block index limit on big blocks.
Even a mini stream (64 byte blocks for a 512 bigblock file) shouldn't, by my
calculation, be able to exceed the 2^31 limit whilst still staying under 2gb
for the overall filesize.

I *think* that only 4096 byte block files should be able to get into the
0x80000000+ sector number range. Even if they did that with just the
ministream, that's still a 128gb+ test file to trigger it, unless my maths is
off!

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