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 2010/03/20 02:09:00 UTC

DO NOT REPLY [Bug 48936] Writing specific sequence of strings to XSSFSheet results in malformed XML

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

--- Comment #1 from Josh Micich <jo...@gildedtree.com> 2010-03-20 01:08:57 UTC ---
Created an attachment (id=25154)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25154)
A simplified version of the strings file

The problem seems to be within piccolo (part of xmlbeans).  The encoding logic
is incorrectly identifying the ']]' in one string as ']]>' and thus attempts a
mis-aligned escape.  This logic is being performed in a buffer which gets
re-used multiple times across the document.  When piccolo reads one character
too far, it reads whatever was left in the buffer from the previous use.  If
the input data is constructed carefully, the '>' character may be incorrectly
detected.

There are many sets of data which can cause this problem though they can be a
little hard to find.  Here are a few guidelines:
  - there needs to be enough total data to cause a wrap around in the buffer. 
The problem occurs with strings written after the first buffer flush.
  - one of those strings needs to 
     - be longer than 32 chars, 
     - have more than 5 entities that need escaping (e.g. '>')
     - end in ']]'
  - the lengths of all previous strings are chosen to cause a '>' from the
previous buffer usage align with the']]'

This bug should probably be forwarded off to the xmlbeans team.  It will
probably take some effort to create a test case that is independent of POI.

xmlbeans 2.5.0 displays the same problem (POI currently uses 2.3.0)

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