6845701: Xerces2 Java XML library infinite loop with malformed XML input
Reviewed-by: hawtin
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java Thu Jun 11 21:26:25 2009 -0700
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java Mon Jun 22 13:56:30 2009 -0700
@@ -1027,6 +1027,9 @@
int c = fEntityScanner.peekChar();
if (XMLChar.isMarkup(c) || c == ']') {
fStringBuffer.append((char)fEntityScanner.scanChar());
+ } else if (c != -1 && isInvalidLiteral(c)) {
+ reportFatalError("InvalidCharInSystemID",
+ new Object[] {Integer.toString(c, 16)});
}
} while (fEntityScanner.scanLiteral(quote, ident) != quote);
fStringBuffer.append(ident);