-
Bug
-
Resolution: Fixed
-
P3
-
8u20
-
b40
-
x86_64
-
windows_7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8083927 | emb-9 | Joe Wang | P3 | Resolved | Fixed | team |
JDK-8071223 | 8u60 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8065474 | 8u45 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8064389 | 8u40 | Aleksej Efimov | P3 | Resolved | Fixed | b15 |
JDK-8065381 | 8u31 | Aleksej Efimov | P3 | Resolved | Fixed | b10 |
JDK-8070049 | emb-8u47 | Aleksej Efimov | P3 | Resolved | Fixed | team |
JDK-8067074 | emb-8u33 | Aleksej Efimov | P3 | Resolved | Fixed | b04 |
JDK-8072245 | 7u85 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8064390 | 7u80 | Aleksej Efimov | P3 | Resolved | Fixed | b04 |
JDK-8065856 | 7u79 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8065380 | 7u76 | Aleksej Efimov | P3 | Closed | Fixed | b10 |
JDK-8064393 | 6u95 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8065379 | 6u91 | Aleksej Efimov | P3 | Resolved | Fixed | b10 |
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) Client VM (build 25.20-b23, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Parsing the XML contained in the sample program provided gives a wrong value "q" for the attribute a1. The correct value is "w".
The problem depends on the "e; value of the second attribute a2 and the buffer sizes used when parsing the XML. If a previous read stops after "...&q" then the last entity character "q" corrupts the string buffer of the previously read attribute a1. Therefore the attribute a1 returns the value "q" instead of "w".
REGRESSION. Last worked in version 7u40
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) Client VM (build 25.20-b23, mixed mode, sharing)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Simply run the program attached to this issue and see the output "q".
"w" would be the correct output.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Attribute "a1" should have the value "w" not "q" as it is with Java 1.7 Update 40
ACTUAL -
Attribute "a1" has value "q".
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.ByteArrayInputStream;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
public class XMLParserBug {
public static void main(String[] args) throws Exception {
Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ChunkInputStream());
System.out.println(d.getDocumentElement().getAttribute("a1"));
}
static class ChunkInputStream extends ByteArrayInputStream {
ChunkInputStream() {
super("<element a1=\"w\" a2=\"""\"/>".getBytes());
}
@Override
public synchronized int read(byte[] b, int off, int len) {
return super.read(b, off, 9);
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Change buffer sizes when reading the XML file. This may produce the same problem with other XMLs, since it depends on the XML structure and the buffer sizes.
- backported by
-
JDK-8064389 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8064390 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8064393 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8065379 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8065381 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8065474 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8065856 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8067074 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8070049 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8071223 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8072245 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8083927 XML parser returns corrupt attribute value
-
- Resolved
-
-
JDK-8065380 XML parser returns corrupt attribute value
-
- Closed
-
- duplicates
-
JDK-8140747 Data corruption when parsing XML using StAX/Xerces
-
- Closed
-
-
JDK-8144651 Corruption when parsing large XML files chunked over HTTP
-
- Closed
-
-
JDK-8061550 XMLEntityScanner can corrupt content during parsing
-
- Closed
-
- relates to
-
JDK-8167340 XMLStreamReader.getElementText return corrupt content when size of element is > 8192
-
- Resolved
-
-
JDK-8067104 Parsing XML 1.1 files with SAX gives unexpected results
-
- Closed
-