JDK-8034087 : XML parser may overwrite element content if that content falls onto the border of an entity scanner buffer
  • Type: Bug
  • Component: xml
  • Sub-Component: javax.xml.parsers
  • Affected Version: 6-pool,7-pool,8-pool
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-02-10
  • Updated: 2014-04-18
  • Resolved: 2014-02-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b04Fixed
Related Reports
Duplicate :  
Description
Given a simple XML document like the following one:

<?xml version=\"1.1\"?>
<ROOT>
   <FILLER>ffffffff...fffff</FILLER>
   <TEST>content</TEST><TEST2>content2</TEST2>
   <FILLER>ffffffff...fffffffff</FILLER>
</ROOT>

the content of the TEST elements may be overwritten by content from the following elements (i.e. 'f's) if the content of the TEST elemts is at the border of an entity scanner buffer (XMLEntityScanner uses 8192 byte buffers) and there is still enough content to read after the TEST elements such that another buffer read is required.

Comments
This issue is indeed a duplicate of 8027359, so there's no need to provide a fix any more. Nevertheless we have a nice test case for this bug which we will submit under this bug id.
11-02-2014

This may be duplicate of https://bugs.openjdk.java.net/browse/JDK-8027359. Will check and close this as duplicate if the fix for 8027359 helps in this case as well.
10-02-2014